Collapse Hierarchy



A superclass and subclass are not very different.

Merge them together.


For more information see page 344 of Refactoring





***** 아름다운프로님에 의해서 게시물 복사 + 카테고리변경되었습니다 (2003-12-18 17:27)
Posted by 아름프로

Change Value to Reference



You have a class with many equal instances that you want to replace with a single object.


Turn the object into a reference object.


For more information see page 179 of Refactoring





***** 아름다운프로님에 의해서 게시물 복사 + 카테고리변경되었습니다 (2003-12-18 17:27)
Posted by 아름프로

Change Unidirectional Association to Bidirectional



You have two classes that need to use each other's features, but there is only a one-way link.

Add back pointers, and change modifiers to update both sets.


For more information see page 197 of Refactoring

Additional Comments


Doing a remove

In the example I showed an addOrder method, but I didn't show the removeOrder method. If you want to do a remove, you would write it like the add method but set the customer to null.

Class Customer ...
void removeOrder( Order arg ) {
  arg.setCustomer( null );
}

Contributors


- Andy Bulka
- Don Roberts



***** 아름다운프로님에 의해서 게시물 복사 + 카테고리변경되었습니다 (2003-12-18 17:27)
Posted by 아름프로

Change Reference to Value



You have a reference object that is small, immutable, and awkward to manage.

Turn it into a value object.


For more information see page 183 of Refactoring





***** 아름다운프로님에 의해서 게시물 복사 + 카테고리변경되었습니다 (2003-12-18 17:27)
Posted by 아름프로

Change Bidirectional Association to Unidirectional



You have a two-way association but one class no longer needs features from the other.

Drop the unneeded end of the association.


For more information see page 200 of Refactoring





***** 아름다운프로님에 의해서 게시물 복사 + 카테고리변경되었습니다 (2003-12-18 17:27)
Posted by 아름프로

Add Parameter


A method needs more information from its caller.

Add a parameter for an object that can pass on this information.



For more information see page 275 of Refactoring





***** 아름다운프로님에 의해서 게시물 복사 + 카테고리변경되었습니다 (2003-12-18 17:27)
Posted by 아름프로

BLOG main image

카테고리

분류 전체보기 (539)
이야기방 (19)
토론/정보/사설 (16)
IBM Rational (9)
U-IT (0)
SOA/WS/ebXML (110)
개발방법론/모델링 (122)
UML (4)
XP/TDD (1)
RUP (0)
Agile Programming (1)
Others (14)
Testing (2)
Unit Test (1)
POSA (1)
Architecture (1)
Patterns (1)
Refactoring (96)
J2SE (34)
J2EE (60)
DataBase (39)
Open Projects (30)
BP/표준화 (50)
Apache Projects (15)
Web/보안/OS (22)
Tools (7)
AJAX/WEB2.0 (1)
Linux/Unix (1)
영어 (0)
비공개방 (0)

최근에 올라온 글

최근에 달린 댓글

최근에 받은 트랙백

달력

«   2025/02   »
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28

글 보관함

Total :
Today : Yesterday :