Distributed reconfiguration of JBuilder2005 to realize reconfiguration

Source: Internet
Author: User

Because of the complexity of software engineering, a large software is often cut into different sub software modules, which are assumed by different teams. Suppose a large software is divided into three sub modules:

· A module: The low-level processing class module.

· Module B: High-level Business Module 1.

· C Module: High-level Business Module 2.

The A module, as the underlying module, is called by the B and C modules, but since a module is developed by a separate team (represented as a separate project in JBuilder), the refactoring of a module is performed only in the current project. JBuilder will record the refactoring trajectory and allow you to include these refactoring records through the jar file, which can be applied to B and C module projects when B and C module projects reintroduce A's jar file through the Engineering class library. This kind of reconstruction solves the problem of reconfiguration between related engineering, which is called distributed reconfiguration.

To demonstrate distributed refactoring, we recreated a new engineering common_lib, developing a dateutils class:

Code list Dateutils Class

1. package common_lib;
2. public class DateUtils {
3.  public static String getNowTime()
4.  {
5.   return ""+(new Java.util.Date());
6.  }
7. }

The Common_lib project is turned into Common_lib.jar package output, and a Extralib subfolder is created under the Myrefactor Engineering directory, which copies Common_lib.jar to this folder and references the jar package in the Engineering Extension class library.

Create a new distribute class in Myrefactor, referencing the Dateutils.getnowtime () in Common_lib.jar, whose code looks like this:

Code Listing 22 A class that references Common_lib engineering in Myrefactor Engineering

1. package myrefactor ;
2. import common_lib.DateUtils;
3. public class Distribute
4. {
5.  public void printCurrTime()
6.  {
7.   System.out.println(DateUtils.getNowTime()) ;
8.  }
9. }

After a while, the owner of the Common_lib project reconstructs the Dateutils.getnowtime () method name and renamed it Getcurrtime (). Through Refactor->refactoring History ... Pull up the Refactoring History dialog box, as shown in the following illustration:

Figure 30 Refactoring History

The dialog box lists all the refactoring histories for the current project, and you may not want to distribute all of the refactoring, so you can delete those refactoring records with the Remove button.

For this method renaming refactoring is distributed to other projects that refer to the project, you need to include refactoring information when you package.

If you already have a packaged node in the Common_lib Engineering resource tree, just right-click the node to select Properties in the pop-up menu, package the settings, and in the pop-up properties for ' Archive ' Select the refactoring Settings page as shown in the following illustration:

Figure 31

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.