学习使用Borland Together心得体会(四)

本文介绍了Jbuilder和Together的同步处理功能。在Jbuilder里修改MyThread类添加属性,Together能自动同步;在Together里删除属性并添加新方法,Jbuilder也会相应变化。用户可放心在两者中工作,后续还将介绍Together里使用模式开发。

 

两者的同步处理
如果我们在Jbulder里面修改了源代码,或者在Together里面改变了设计思路,绘制了新的类图,那么会发生什么呢?让我们来看看
首先:我们看看Together里面的类图,看了类图以后,我们就开始修改。

我们可以看见,这个工程里面只有两个类,一个是MyThread,从Thread类继承,实现了run方法,有一个公有的contructor,另外一个Hello类,有一个main方法,它在Main方法里面启动了两个MyThread线程。

好了,现在我们已经可以进入到下一步了,在Jbuilder里面修改它,我的设想是在Mythread类里面添加一个property(name),get,set方法。这在Jbuilder里面非常容易做到。如图:

这样OK之后,在MyThread类的源代码里面就有了新的propertygetset方法了,那么,我们这样修改了MyThread类,Together能知道吗,它的视图如何和我们的修改做同步呢?难道还要我们继续在Together里面修改MyThread类的视图吗?那个事情可真是一场恶梦啊。不过,你不用害怕,borland是不会让你失望的

接上一步,我准备看看Together里面发生了什么,于是我打开了Together,发生了什么:
右下角的一个进度条在显示synchronzing…,不过这个过程只花了23秒,然后就这样了。

大家看见了,Together自动把这个类做了同步,它的属性列表里面已经出现了我们刚才添加的属性。不错啊

现在继续:我在together里面把我们刚才添加的属性删除,然后添加一个新的方法test,如图:


现在看看Jbuilder里面发生了什么:

果然它相应的发生了变化。

总之,我们可以放心的在这两个利器里面工作,无论谁发生了变化,我们都可以看见相应的变化发生了。当然,这个功能只是togetherJBE里的一个小小的功能而已。后面我将会介绍更加强大的功能。

 

我将在以后介绍在Together里面使用模式开发。

 

---------------------------------

 

声明:本文版权与解释权归赵才文所有,如需转载,请保留完整的内容及此声明。

E-Mail: vipcowrie@sina.com

 

Borland Together Together Modeling Modeling and Diagrams New (Bug 23): The Enhanced Rich Text Editor for properties is no longer an early access feature, and can be enabled or disabled in the Capabilities window ( Window -> Preferences -> Capabilities -> Advanced -> Modeling -> Enhanced Rich Text Editing). This capability is enabled by default. New (Bug 2261, Trk#30135): Ant task provided for running OCL based Model audits/metrics. Please refer topic Borland Together Modeling Guide > Procedures > Together Quality Assurance > Running Model Audits and Metrics as Ant Tasks in the online help for details. New (Bug 2478, Trk#36928): Added ability to choose alternative way of storing properties of packages in package model files (default.txaPackage). This information is typically stored in the default package diagram files (default.txvpck or default.txvClassDiagram20). This alternative way enables keeping such properties synchronized across the team even when package diagrams are excluded from version controlling (with the Preferences -> Team -> Modeling resources -> Ignore default package diagrams option). The Store package properties in package diagram files option can be changed from the new modeling project wizard or in the Project Properties dialog. Because changing this option in the Project Properties dialog for existing project results in the one-time conversion of affected project files, this option should be used with caution. Note that projects switched to this alternative storage of package properties cannot be opened in earlier versions of the product. New (Bug 2490, Trk#27573): Provided the ModelValidator tool that looks for the severe model problems (broken links, duplicate uins, etc). Fixed (Bug 3155, Trk#36964): UML 2.0, Behavior: You can now use the Properties Inspector to specify multiple pre-postconditions for behaviors. New (Bug 3184): Properties inspector now saves changes automatically when application exits. Fixed (Bug 4264): UML 2.0, Sequence diagram: Lifeline head changes its shape depending on the metaclass of the represented classifier. Supported for Actor and Component metaclasses. Fixed (Bug 4488): Issue with dependencies has been fixed in 'UML to WSDL transformation Project' sample. Fixed (Bug 4496): When you copy elements with hyperlinks from a referenced project, the hyperlink destination is now changed to the corresponding element in the target project. Fixed (Bug 4520): Profiles, properties of enum type: You can now localize enum literals. New (Bug 4522): Added support for hidden compartments in UML 2.0 modeling projects. New (Bug 4615): Warning message describing paste semantics is shown during copy/paste operations. A switch is provided in Window -> Preferences -> Modeling -> Copy/Paste -> Show warning about relationship when elements copied to enable or disable the warning dialog. New (Bug 4631): Scope for Profile Constraints checking (Model -> Profile -> Run Profile Constraints) now can be specified. Available scopes are project, package, and selected resource. Fixed (Bug 4717 (2382), Trk#17851): Profiles: Initial value of stereotype attribute is now used as default value of corresponding stereotype-specific property.
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值