Anyone can reconstruct

xiaoxiao2021-03-06  79

Method and reasons for automatic reconstruction characteristics using Eclipse

Level: Intermediate

David Gallardo (David@gallardo.org) Software Consultant November 2003

Eclipse provides a set of refactoring features that are in other functions, enabling you to rename Java elements, mobile classes, and packages, create interfaces from specific classes, and change nested classes A new method is taken out of the top class, and the new method is taken from the code snippet of the old method. After you are familiar with the Eclipse's reconstruction tool, you have mastered a good way to improve productivity. This article refutes the characteristics of Eclipse, and the methods and reasons for the use of these characteristics are clarified.

Why is it reconstructed?

Refactoring means changing its structure without changing the program function. Reconstruction is a powerful technology, but it is necessary to do it to be careful. The main hazard is that some errors may be introduced inadvertently, especially when handling manual reconstruction. This hazard has triggered a general criticism of reconstruction techniques: Why do you want to modify it when the code will not crash?

There may be the following reasons for code reconstruction: The first reason for the legend is that you need to inherit an era for an ancient product, or suddenly encounter these code. The initial development team is not there. We must create new version of software that adds new features, but these codes have not been understood. The new development team ends in the day, deciphering the code and maps the code. After a lot of planning and design, people divide these code into fragments. After over-hardship, all these things are returned in accordance with the requirements of the new version. This is a hero-like reducing story, almost no one can live a story about such a story.

There is also a realistic situation that there is a new demand in the project and needs to be modified. As is due to the disappointment during the initial planning process, the two is not intentionally introduced during the development process due to an iterative development process (such as agile development, or test-driven development). . Such reconstruction is much smaller, and its contents generally involve inheritance relationships of categories by introducing an interface or abstract class, and segmenting and reorganizing classes, and so on.

The last reason for reconstruction is that when there is an available automatic reconstruction tool, there can be a shortcut to pre-gentle code - it is like a spelling when you can't determine how to spell a word. Check the tool to enter this word. For example, you can generate a getter and setter method with this dull-free reconstruction method. Once you are familiar with such a tool, it can save you a lot of time.

Eclipse's reconstruction tool unintentionally performs hero-level reconstruction - it is almost no use of this scale - but whether it uses agile development technology, Eclipse's tools are unable to measure the work of the general programmer to modify the code. . After all, any complicated operation can be not so bored as long as it is possible. As long as you know what restructuring tools have achieved Eclipse, your productivity will be greatly improved.

There are two important ways to reduce the risk of damage to the code. The first method is a completely thorough unit test for the code: before and after reconstruction, you must pass this test. The second method is to use an automated tool to reconstruct, such as the reconstruction characteristics of Eclipse.

The combination of thorough testing and automation will be more effective, so refactoring is also a useful daily tool from a mysterious art. In order to increase the new function or improve the maintenanceability of the code, we can change its structure without affecting the original code function. This ability will have a great impact on your design and development code, even if you don't have the relationship between the formal agile method.

Eclipse's reconstructed type Eclipse's reconstruction tool can be divided into three categories (the order below is the order in which these tools appear in the Refactoring menu): rename the code and change the physical structure of the code, including the attribute, Renames, classes, and interfaces are renamed, as well as mobile packages and classes. Change the code logical structure of the class level, including transitioning anonymous classes into nested classes, transitioning the nested class into top class, created an interface according to the specific class, and moving the method or property from a class to subclass or parent Class. Change the code inside the class, including the attribute that changes the local variable into a class, turn the code selected in a method into an independent method, and generate the Getter and Setter methods for the attribute.

There are also several reconstruction tools that cannot be completely attached to these three types, especially Change Method Signature, but this tool is classified into a third category. In addition to this exception, the following sequences will be discussed in the order in the above sequence.

Physical Recombination and Renaming Obviously, you can rename files or mobile files in the file system, but if the operation object is a Java source code file, you need to edit a lot of files, update the import or Package statement. Similar to this, search and replacement with some text editor can also be renamed to classes, methods, and variables, but must be very careful when doing this, because different classes may have a similar method or variable If you check all the files in the project from the end to ensure the correctness of each thing and the correctness of the modification, that is really bored.

Eclipse's Rename and Move tools are very smart to complete such modifications throughout the project without requiring user interference. This is because Eclipse can understand the semantics of the code, which is capable of identifying a reference to a particular method, variable, or class name. Simplify this task helps ensure that the names, variables, and classes can clearly indicate their use.

We often find that the name of the code is inappropriate or easier to misunderstand because the code is different from the original function. For example, a program for finding a specific word in a file may extend to get an InputStream operation through the URL in a web page. If this input is originally called File, it should modify its name so that it can reflect the new more general features, saying SourceStream. Developers often cannot successfully modify these names because this process is very confusing and boring. This of course also can't confuse the next developer who has to operate these classes.

To rename a Java element, just simply click this element from the Package Explorer view, or select this element from the Java source file, then select the menu item Refactor> Rename. Enter a new name in the dialog, then select whether eclipse also changes to this name. The actually displayed exact content is related to the type of your selected element. For example, if the selected attribute has a getter and setter method, you can update the name of these methods at the same time to reflect the new properties. Figure 1 shows a simple example.

Figure 1. Rename a local variable

Just like all Eclipse reconstruction operations, you can click the Preview button after you specify all the necessary information to perform reconstruction, then in a dialog, which changes to Eclipse intend to intend to, you can separate or Confirm that each change in each of the affected files is confirmed. If you have confidence in Eclipse's correct implementation of changes, you can press the OK button. Obviously, if you are not sure about what is done, you will want to preview first, but it is usually not necessary to preview for a simple reconstruction of Rename and Move. Move operation is very similar to Rename: You choose a Java element (usually a class), specify a new location for it and define if you need to update references. You can then select Preview to check the change, or select OK to perform reconstruction immediately, as shown in Figure 2.

Figure 2. Move the class from one package to another package

On some platforms (especially Windows), you can also move the class from a package or folder to another in the Package Explorer view method in another package or folder. All references will be automatically updated.

Reproduction The relationship between the class Eclipse has a large number of reconstruction tools to automatically change the relationship between the class. These reconstruction tools do not use other tools provided by Eclipse, but it is valuable because they can perform very complex tasks. It can be said that when they use it, it will be very useful.

Increase anonymous class with Nested CONVERT Anonymous Class (Convert Anonymous) and Convert Nested Type These two reconstruction methods are similar, they all move a class from its current range to contain this class. The range.

Anonymous class is a syntax speed write tag that enables you to create a class instance in a place where you need an abstract class or interface, without an explicit provider name. For example, when you create a listener in a user interface, you often use anonymous classes. In Listing 1, it is assumed that the BAG is an interface defined elsewhere, which declares two methods, GET (), and set ().

Listing 1. BAG class

Public Class Bagexample

{

Void ProcessMessage (String MSG)

{

Bag Bag = new bag ()

{

Object O;

Public Object GET ()

{

Return O;

}

Public void set (Object O)

{

THIS.O = O;

}

}

Bag.set (MSG);

MessagePipe Pipe = new messagepipe ();

Pipe.send (BAG);

}

}

When anonymous class becomes large, when the code is difficult to read, you should consider turning this anonymous class into a strict sense; in order to keep encapsulation (in other words, it is hidden to hide it, make it don't have to know Its external class does not know it), you should turn it into a nested class, not a top class. You can click on this anonymous class, then select Refactor> Convert Anonymous Class to Nested. When the confirmation dialog appears, enter names for this class, such as BagImpl, then select Preview or OK. In this way, the code becomes the situation as shown in Listing 2.

Listing 2. Reconstructive BAG class

Public Class Bagexample

{

PRIVATE FINAL CLAS BAGIMPL IMPLEMENTS BAG {

Object O;

Public Object GET ()

{

Return O;

}

Public void set (Object O)

{

THIS.O = O;

}

}

Void ProcessMessage (String MSG)

{

Bag Bag = new bagimpl ();

Bag.set (MSG);

MessagePipe Pipe = new messagepipe ();

Pipe.send (BAG);

}

}

When you want other classes to use a nested class, Convert Nested Type to Top Level is useful. For example, you can use the value object in a class, just like the BagImpl class above. If you decide to share this data between multiple classes, the reconstruction operation can create new class files from this nested class. You can highlight the class name in the source code file (or click the name in the Outline view), then select Refactor> Convert Nested Type to Top Level, which is refactored.

This reconstruction requires you to provide a name for the load instance. Reconstruction tools will also provide recommendations, such as Example, you can accept this name. The meaning of this name is clear for a while. After clicking OK, the outer class Bagexample will become the sample shown in Listing 3.

Listing 3. Reconstructive BAG class

Public Class Bagexample

{

Void ProcessMessage (String MSG)

{

Bag Bag = New Bagimpl (this);

Bag.set (MSG);

MessagePipe Pipe = new messagepipe ();

Pipe.send (BAG);

}

}

Note that when a class is nested, it can access the members of the outer class. In order to retain this function, the reconstruction process places a instance of a load Bagexample in front of the nesting class. This is the instance variable that previously asked you to enter the name. Constructor for setting this instance variable is also created. The new class BagImpl created by the reconstruction process As shown in Listing 4.

Listing 4. BagImpl class

Final Class Bagimpl IMPLEMENTS BAG

{

PRIVATE FINAL BageXample Example;

/ **

* @PaRambagexample

* /

BagImpl (Bagexample Example)

{

THIS.EXAMPLE = EXAMPLE;

// Todo Auto-Generated Constructor Stub

}

Object O;

Public Object GET ()

{

Return O;

}

Public void set (Object O)

{

THIS.O = O;

}

}

If your situation is the same as this example, you don't need to keep access to Bagexample, you can safely delete this instance variable with constructor, change the code in the Bagexample class to the default non-parameter constructor.

The mobile members in the class inheritance also have two reconstruction tools, PUSH DOWN, and PULL UP, respectively implement class methods or properties from one class from one class or parent class. Suppose you have an abstract class called VEHICLE, which is defined as shown in Listing 5.

Listing 5. Abstract Vehicle Class

Public Abstract Class Vehicle

{

Protected Int passengers;

protected string motor; public int getPassengers ()

{

Return Passengers;

}

Public void setPassengers (INT i)

{

Passengers = i;

}

Public String getMotor ()

{

Return Motor;

}

Public void setmotor (String String)

{

Motor = String;

}

}

You also have a subclass of VEHICLE, named Automobile, as shown in Listing 6.

Listing 6. Automobile class

Public Class Automobile Extends Vehi

{

PRIVATE STRING MAKE;

PRIVATE STRING Model

Public String getmake ()

{

Return Make;

}

Public String getModel ()

{

Return model;

}

Public void setmake (String String)

{

Make = String;

}

Public void setmodel (String String)

{

Model = String;

}

}

Please note that Vehicle has an attribute that is Motor. If you know that you will only process your car, then you will do it well; however, if you also allow you to have something like a rowboat, then you need to put the Motor property from the VEHICLE class into the Automobile class. To do this, you can select MOTOR in the Outline view, then select Refactor> Push Down.

Eclipse is quite smart, it knows that you can't always move a certain property itself, so I also provide the Add Required button, but in Eclipse 2.1, this feature does not always work correctly. You need to verify that all methods that depend on this property are pushed to the next layer. In this example, such a method has two, that is, the getter and setter methods accompanying MOTOR, as shown in FIG.

Figure 3. Join the required member

After pressing the OK button, Motor attributes and getmotor () and setmotor () methods are moved to the Automobile class. Listing 7 shows the case of the Automobile class after this reconstruction.

Listing 7. Reconstructive Automobile class

Public Class Automobile Extends Vehi

{

PRIVATE STRING MAKE;

PRIVATE STRING Model

protected string motor;

Public String getmake ()

{

Return Make;

}

Public String getModel ()

{

Return model;

}

Public void setmake (String String)

{

Make = String;

}

Public void setmodel (String String)

{

Model = String;

}

Public String getMotor ()

{

Return Motor;

}

Public void setmotor (String String)

{

Motor = String;

}

}

PULL UP Reconstruction Almost the same as PUSH DOWN, of course, the PULL UP is mushing the class member from a class to its parent class, not the subclass. If you change your idea later, decide whether to move Motor back to the Vehicle class, then you may use this reconstruction. Also need to remind you, be sure to make sure you have selected all the required members. Motor in the Automobile class, which means you create another subclass, say BUS, you also need to add Motor (and its related methods) to the BUS class. There is a way to represent this relationship, which creates an interface called Motorized, both Automobile and Bus implement this interface, but Rowboat is not implemented.

The easiest way to create a Motorized interface is to use Extract Interface reconstruction on Automobile. To do this, you can select Automobile in the Outline view, then select Refactor> Extract Interface from the menu. You can select which methods you want to include in the interface in the pop-up dialog box, as shown in Figure 4.

Figure 4. Abstract Motorized interface

After clicking OK, the interface is created, as shown in Listing 8.

Listing 8. Motorized interface

Public interface motorized

{

Public Abstract string getmotor ();

Public Abstract Void SetMotor (String String);

}

At the same time, the class declaration of Automobile has also become the following:

Public Class Automobile Extends Vehicle Implements Motorized

The last one in the User Supertyp Where Possible is used using the parent class. Imagine an app to manage car detail. It uses Automobile types from start to end. If you want to handle all types of means of transport, you can use this reconstruction to turn all the reference to the Automobile into a reference to the Vehicle (see Figure 5). If you perform any type checking in the code in the code, you will need to decide to apply the original class or a parent class, then select the first option "Use the selected supertype in 'instanceof' expnessions".

Figure 5. Change Automobile to its parent Vehicle

The use of the parent class often occurs in the Java language, especially if the Factory Method mode is used. The typical implementation of this mode is to create an abstract class, which has a static method crete (), which is returned to an specific object that implements this abstract class. This mode can be used if the type of specific object to be created is dependent on the details of the implementation, and the call class can use this mode for the implementation details.

Changing the code inside the class is a class of reconstruction that the reconstitution method of the encoded internal code restructuring is implemented. In all reconstruction methods, only such methods allow you to introduce or remove intermediate variables, create a new method according to some of the code in the original method, and create a getter and setter methods for properties.

Extract and embedded have some reconstruction method to begin with Extract: Extract Method, Extract Local Variable, and Extract Constants. The first Extract Method means that you may have already guessed it, it creates a new method according to your code. We take the main () method of the class in Listing 8 as an example. It first obtains the value of the command line option. If there is an option starting with the -d, it is stored in a list-value object in the form of a name-value. Listing 8. Main ()

Import java.util.properties;

Import java.util.StringTokenizer;

Public Class StartApp

{

Public static void main (string [] args)

{

Properties PROPS = New Properties ();

For (int i = 0; i

{

IF (Args [i] .StartSwith ("- D")))

{

String s = args [i] .substring (2);

StringTokenizer ST = New StringTokenizer (s, "=");

IF (st.countToKens () == 2)

{

PROPS.SETPROPERTY (St.NextToken (), st.nextToken ());

}

}

}

//undinue ...

}

}

There are two main codes from one way and put it in another method. The first reason is that this method is too long and has completed more than two logically distinct operations. (We don't know what the main () method has to process, but from the evidence that is now mastered, this is not a reason to extract a method.) Another reason is a logical clear code, This code can be reused by other methods. For example, at some point, you find that you have repeatedly prepared the same line of code in many different methods. Then there is a need for reconstruction, but unless I really need to reuse this part of the code, you may not be able to perform reconstruction.

Suppose you need to resolve the name-value pair in another place, and put it in the Properties object, then you can extract this code that contains the StringTokenizer declaration and the following IF statement. To do this, you can choose this code, then select Refactor> Extract Method from the menu. You need to enter the method name, enter AddProperty, then verify the two parameters of this method, Properties PROP, and STRINGS. Listing 9 shows the case after the addprop () method is extracted by Eclipse.

Listing 9. Approiled addprop ()

Import java.util.properties;

Import java.util.StringTokenizer;

Public Class EXTRACT

{

Public static void main (string [] args)

{

Properties PROPS = New Properties ();

For (int i = 0; i

{

IF (Args [i] .StartSwith ("- D")))

{

String s = args [i] .substring (2);

Addprop (PrOPS, S);

}

}

}

Private static void addprop (property prot, string s) {

StringTokenizer ST = New StringTokenizer (s, "=");

IF (st.countToKens () == 2)

{

PROPS.SETPROPERTY (St.NextToken (), st.nextToken ());

}

}

}

Extract Local Variable Reconstruction Removes a direct use of the expression, then assigns this expression to a local variable first. This variable is then used in places where the expression is used. For example, in the above method, you can select the first call to St.NextToken (), then select Refactor> Extract Local Variable. You will be prompted to enter a variable name, here entering Key. Note that there is an option to replace all the places that appear in the selected expression into a reference to a new variable. This option is usually applicable, but the nexttoken () method here is not applicable, because this method (obviously) returns a different value when the call is time. Confirm this option is not selected. See Figure 6.

Figure 6. Not all replacement selected expression

Next, reconstruction is repeated in the second call st.nextToken (), this time the call is a new local variable value. Listing 10 shows the case of this two reconstruction.

Listing 10. Code after reconstruction

Private Static Void AddProp (Properties Props, String S)

{

StringTokenizer ST = New StringTokenizer (s, "=");

IF (st.countToKens () == 2)

{

String Key = st.nextToken ();

String value = st.nextToken ();

Props.SetProperty (Key, Value);

}

}

In this way, it is beneficial to introduce variables. First, by providing meaningful names for expressions, the tasks of code execution can be clearer. Second, code debugging makes it easier because we can easily check the values ​​returned by the expression. Finally, in the case where multiple instances of the same expression can be replaced with a variable, the efficiency will be greatly improved.

Extract Constant is similar to extract local variable, but you must choose a static constant expression, and the reconstruction tool will convert it into static Final constants. This is very useful when the hard-coded number and string are removed from the code. For example, in the above code, we define the name-value pair with "-d" command line options. First, "-D" is bright, select Refactor> Extract Constant, then enter Define as a constant name. The code after reconstruction is shown in Listing 11:

Listing 11. Code after reconstruction

Public Class EXTRACT

{

Private static factory string define = "-d";

Public static void main (string [] args)

{

Properties PROPS = New Properties ();

For (int i = 0; i

{

IF (args [i] .startswith (define))

{

String s = args [i] .substring (2);

Addprop (PrOPS, S);

}

}

// ...

For each of the reconstruction of each Extract ..., there is a corresponding inline ... Reconstruction, the opposite operation is performed. For example, if you highlight the variable S in the above code, select Refactor> Inline ..., then click OK, Eclipse will directly use Args [i] .substring when calling addprop (), this expression , As shown below:

IF (args [i] .startswith (define))

{

Addprop (PrOPS, Args [i] .substring (2));

}

This is more efficient than the use of temporary variables, and the code has become more briefly. As for such a code, it is easy to read or mix, depending on your point of view. However, it is generally said that such embedded reconstruction is worth recommending.

You can follow the same method of the variable with the embedded expression, highlight the middle method, or static final constant, then select Refactor> inline ..., Eclipse will call the code replacement method of the method, or use The value of constant is replaced with a constant reference.

Package properties typically we believe that exposing the internal structure of the object is a bad practice. This is also the reason why the Vehicle class and its subclasses have private or protected attributes, while using public setter and getter methods to access the properties. These methods can be automatically generated in two different ways.

The first way to generate these methods is to use the Source> Generate Getter and Setter menu. This will display a dialog that contains all Getter and Setter methods that have not yet exist. However, because this approach does not update reference to these attributes with new methods, it is not considered; if necessary, you must complete the work of updated reference. This approach can save a lot of time, but it is best to use it when you create a class, or use it to add new properties to the class, because there is no reference to attributes, so you don't need to modify other code. .

The second way to generate getter and setter methods is to select an attribute, then select Refactor> Encapsulate Field from the menu. This way can only generate a getter and setter method for an attribute at a time, but it is opposite to the Source> Generate Getter and Setter, which can change the reference to this property to a new method.

For example, we can create a new simple version of Automobile, as shown in Listing 12.

Listing 12. Simple Automobile class

Public Class Automobile Extends Vehi

{

Public string make;

Public string model;

}

Next, create a class instantiate the class of Automobile and directly access the Make property, as shown in Listing 13.

Listing 13. Instantization Automobile

Public Class AutomobileTestSt

{

Public void race ()

{

Automobilecar1 = new automobile ();

Car1.make = "austin healy";

Car1.model = "sprite";

// ...

}

}

The Make property is now encapsulated. First highlight the name of the property, then select Refactor> Encapsulate Field. Enter the name of the getter and setter methods in the pop-up dialog - as you expect, the default method name is getMake () and setmake (). You can also choose how the method in the same class with this property is to continue access to this property, or use these access methods as other classes. (Some people are very inclined to use some of these two ways, but it happens to be in this case. It doesn't matter if you choose, because there is no reference to the Make property in Automobile.) Figure 7. Package properties

After clicking OK, the make attribute in the Automobile class becomes private property, as well as getMake () and setmake () methods.

Listing 14. Reconstructing Automobile class

Public Class Automobile Extends Vehi

{

PRIVATE STRING MAKE;

Public string model;

Public void setmake (String make)

{

THIS.MAKE = Make;

}

Public String getmake ()

{

Return Make;

}

}

The AutomobileTest class also wants to update so as to use the new access method, as shown in Listing 15.

Listing 15. AutomobileTest

Public Class AutomobileTestSt

{

Public void race ()

{

Automobilecar1 = new automobile ();

Car1.setmake ("Austin HEALY");

Car1.model = "sprite";

// ...

}

}

The signature of the change method This article is also the most difficult method of the most difficult to use: Change Method Signature (Signature of the Method). The functionality of this method is obvious - change the parameters, visibility, and returning value of the method. To make such a change to any other method or code that calls this method, it is not so obvious. There is no such thing as this. If the change changes in the reconstructed method, the problem is not defined, or the type mismatch-reconstruction operation will be tagged. You can choose to be reconstructed, and these issues will be corrected later or to cancel. If this reconfiguration triggers a problem in other methods, you must directly modify it after reconstruction.

To clarify this, consider the classes and methods listed in Listing 16.

Listing 16. MethodSIGexample class

Public Class MethodsiGexample

{

Public Int Test (String S, INT I)

{

INT x = i s.length ();

Return X;

}

}

The TEST () method in this class is called by the method in another class, as shown in Listing 17.

Listing 17. CallTest method

Public void caltest ()

{

MethodSIGexample EG = New MethodSIGexample ();

INT R = Eg.Test ("Hello", 10);

}

In the first class, highlight Test, then select Refactor> Change Method Signature. You will see the dialog shown in Figure 8.

Figure 8. Change method Signature Options

The first option is to change the visibility of the method. In this example, it is changed to protected or private, so the second class's CallTest () method cannot access this method. (If these two classes are in different packets, the access method will be set to the default value.) Eclipse does not marke these problems when reconstructing, you only have your own value . One of the following options are changed the return value type. If the return value is changed to float, this will not be marked into an error, because the Test () method returns Int in the statement to automatically convert to Float. Even so, problems can also cause problems in the CallTest () method of the second class because Float cannot be converted to int. You need to change the return value of the test () to INT, or change R in Calltest () to float.

If the type of the first parameter is turned from String into int, then the same problem is considered. These problems will be marked in the process of reconstruction because they will cause problems inside the reconstructed method: INT does not have a method Length (). However, if it turns into StringBuffer, the problem will not mark it because StringBuffer does have method length (). Of course, this will cause problems in the calltest () method because it is transferred in a String when calling Test ().

As mentioned earlier, in the case of reconstruction, no matter whether the issue is marked, you can fix these questions one by one. There is also a way to modify these errors first. If you plan to delete the no longer needed parameter i, you can delete a reference to it from the method you want to reconstruct. The process of removing the parameters is even more successful.

The last thing you need to explain is the default value option. This option value is only applicable to the case where the parameter is added to the method signature. For example, if we joined a type of string parameters, the parameter name is N, its default value is World, then call the test () code in the calltest () method becomes the following:

Public void caltest ()

{

MethodSIGexample EG = New MethodSIGexample ();

INT R = Eg.Test ("Hello", 10, "World");

}

In this seemingly terrible discussion of Change Method Signature Reconstruction, we did not hide the problems, but they have not mentioned that this reconstruction is actually a very powerful tool, which can save a lot of time, usually You must use a careful plan to use it successfully.

Conclusion Eclipse provides the tools that make reconstruction simple, familiar with these tools will help you improve efficiency. Agile development methods use an iterative method to increase program characteristics, so you need to rely on reconstruction techniques to change and expand the design. However, even if you don't use the required formal reconstruction method, Eclipse's reconstruction tool is a method of saving time when performing a general code modification. If you spend more than these tools, you can realize that the time spent is worth it when you use them.

Reference

books

The core works of the reconstruction are refactoring: Improving The Design of Existing Code, author Martin Fowler, Kent Beck, John Brant, William OpdyKe and Don Roberts (Addison-Wesley, 1999). Reconstruction is a way of developing, in Eclipse In Action: A Guide for Java Development (Manning, 2003), the author David Gallardo, Ed Burnette, and Robert McGovern are discussed from the perspective of designing and development projects in Eclipse. This topic. Mode (as mentioned herein) is an important tool for understanding and discussing object-oriented design. The classic works in this regard are Design Patterns: Elements of Reusable Object-Oriented Software, the author is Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides (Addison-Wesley, 1995). The example in Design Patterns is written with C , which is a non-small barrier for Java programmers; Mark Grand's Patterns in Java, Volume Ooney: a catalog of Reusable Design Patterns Illustrate With UML (Wiley, 1998) Mode is translated into a Java language. For a variant of agile programming, please refer to Kent Beck's Extreme Programming Explained: Embrace Change (Addison-Wesley, 1999) Web Site

Martin Fowler's personal website is the reconstruction technology center on the web. For more information on unit testing with JUnit, please visit the JUnit website.

Articles and tutorials on developerWorks

"Refactoring with Eclipse" (DEVELOPERWORKS, November 2001), written in Daniel H. Steinberg, discussed the relevant theoretical knowledge. "Java Design Mode 101" is an introductory tutorial for David written by David (developerWorks, Jan 2002). "Java Design Mode 201" is the advanced mode tutorial written by Paul Monday (DeveloperWorks, April 2002). In "Extend Eclipse's Java Development Tools", Dan Kehn discusses how to extend your own reconstruction mechanism on Eclipse. (DeveloperWorks, July 2003). In the article "Getting Started With The Eclipse Platform", David provides the starting point for in-depth learning Eclipse (DeveloperWorks, November 2002). In the article "DEMYSTIFYING Extreme Programming", ROY W. Miller discusses how to use Junit in Eclipse (DeveloperWorks, May 2003). You can find more articles about Eclipse in the Open Source Projects Zone of DeveloperWorks. You can also see the latest Eclipse Technology Downloads on AlphaWorks. About the author David Gallardo is a writer on Studio B. He is an independent software consultant and writer, expertise for software internationalization, Java web application, and database development. He became a professional software engineer for fifteen years, he has many experience in operating systems, programming languages, and network protocols. He recently developed its database and international development in a BTOB e-commerce company TradeAccess, INC. Prior to this, he was a senior engineer in the INTERNATIONAL PRODUCT DEVELOPMENT group in Lotus Development Corporation, which is responsible for the development of cross-platform libraries supported by Lotus products (including Domino). David is the cost of Eclipse In Action: a Guide for Java Developers (2003). You can contact David via David@gallardo.org.

转载请注明原文地址:https://www.9cbs.com/read-94054.html

New Post(0)