본문 바로가기
테크/기타

마지막 수업 #2 - J2EE 패턴

by ahnne 2011. 10. 29.


클라이언트와 서버의 통신 어떻게 구현하여야 할까.
물론, Java Socket으로 통신을 한다. 그리고 그 중간에 어떤 내용이 왔다갔다 할지 정해야 했다.
강의에 의하면, 바로 TransferObject!!! -를 Serialization!!!(직렬화) 해서 내용을 주고받는 거라고 배웠다.

TO가 무엇이고 Serialization은 또 무엇인가... 여기서 부터 꼬리가 만들어지기 시작하였다...



TO란?
http://java.sun.com/blueprints/corej2eepatterns/Patterns/TransferObject.html
 : TO는 an arbitrary serializable Java object이다.


TO전략 - Updatable TO Strategy
 : In this strategy, the Transfer Object not only carries the values from the BusinessObject to the client, but also can carry the changes required by the client back to the business object.
 

TO전략 - Multiple TO Strategy
 : when the business object is implemented as a session bean, typically applying the Session Facade pattern, the bean may interact with numerous other business components to provide the service. The session bean produces its Transfer Object from different sources. Similarly, when the BusinessObject is implemented as a coarse-grained entity bean, typically applying the Composite Entity pattern, the entity bean will have complex relationships with a number of dependent objects.




Business Object란?
 : (problem) - You have a conceptual domain model with business logic and relationship.




Domain Model이란?
(일반적인)
http://en.wikipedia.org/wiki/Domain_model
 : A domain model in problem solving and software engineeringcan be thought of as a conceptual model of a domain of interest (often referred to as a problem domain) which describes the various entities, their attributes, roles and relationships, plus the constraints that govern the integrity of the model elements comprising that problem domain.

※ Domain Model vs. DTO : http://toby.epril.com/?p=99
※ Domain Model vs DTO : http://babtingdev.tistory.com/51
※ Rich Domain Model : http://aeternum.egloos.com/2628475
※ 객체지향적인 도메인 레이어 구축하기 : http://aeternum.egloos.com/2860209




Entity Bean이란?
http://en.wikipedia.org/wiki/Entity_Bean
http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/EJBConcepts4.html 
 : 데이터베이스에서 관리되어 영속성이 유지되는 데이터
※  In EJB 3.0 (Java EE 5) those Entity Beans have been replaced by Java Persistence API entities.




JPA란?
http://en.wikipedia.org/wiki/Java_Persistence_API
 : Java programming language framework managing relational data in applications using Java Platform, Standard Edition and Java Platform, Enterprise Edition




Session Bean이란?
http://en.wikipedia.org/wiki/Session_Beans

Contrary to JPA Entities, which represent persistent data maintained in a database, a Session Bean implements a business task and is hosted by an EJB container.

A session bean performs operations, such as calculations or database access, for the client. Although a session bean can be transactional, it is not recoverable should a system crash occur. Session bean objects either can be stateless or can maintain conversational state across methods and transactions. If a session bean maintains state, then the EJB container manages this state if the object must be removed from memory. However, the session bean object itself must manage its own persistent data.





Composit Entity란?
http://www.corej2eepatterns.com/Patterns2ndEd/CompositeEntity.htm
http://java.sun.com/blueprints/corej2eepatterns/Patterns/CompositeEntity.html 
 : You want to use entity beans to implement your conceptual domain model.
 : Entity beans are not intended to represent every persistent object in the object model. Entity beans are better suited for
coarse-grained persistent business objects.




Corse-grained & Fine-grained?
http://www.coderanch.com/t/99845/patterns/Coarse-grained-fine-grained-objects




POJO란?
http://yonghyun.net/2010/03/pojo-plain-old-java-object/ 
http://en.wikipedia.org/wiki/Plain_Old_Java_Object 
 : Plain Old Java Object

※ What is POJO? : http://bytes.com/topic/java/answers/621133-what-pojo
※ Difference between JavaBean & POJO? : http://www.theserverside.com/discussions/thread.tss?thread_id=35146




Transfer Object Assembler?
http://java.sun.com/blueprints/corej2eepatterns/Patterns/TransferObjectAssembler.html
 :  Use a Transfer Object Assembler to build the required model or submodel. The Transfer Object Assembler uses Transfer Objects to retrieve data from various business objects and other objects that define the model or part of the model.




Session Facade?
http://java.sun.com/blueprints/patterns/SessionFacade.html
http://java.sun.com/blueprints/corej2eepatterns/Patterns/SessionFacade.html  

 : Enterprise beans encapsulate business logic and business data and expose their interfaces, and thus the complexity of the distributed services, to the client tier.
 : The Session Facade pattern defines a higher-level business component that contains and centralizes complex interactions between lower-level business components. A Session Facade is implemented as a session enterprise bean. It provides clients with a single interface for the functionality of an application or application subset. It also decouples lower-level business components from one another, making designs more flexible and comprehensible.




헉헉, 마지막으로
J2EE Core Pattern
http://java.sun.com/blueprints/corej2eepatterns/Patterns/index.html