SCJP <br />SCWCD <br />SCBCD <br />SCEA-1
SCJA 1.0, SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCJP 5.0, SCEA 5, SCBCD 5; OCUP - Fundamental, Intermediate and Advanced; IBM Certified Solution Designer - OOAD, vUML 2; SpringSource Certified Spring Professional
Originally posted by wang andrew:
It should be decorator pattern. App server wraps the original bean method and adds other functionalities like transaction, security...
Originally posted by JigaR Parekh:
Then EJBHome should also be example of decorator pattern but it is not see below question which has been asked in Mark Cade book.
Which pattern is used by the Home Interface of an EJB?
A. Proxy
B. Decorator
C. Mediator
D. Factory
The correct answer is D.
Originally posted by JigaR Parekh:
yes i am still confused but not as why EJBObject is example of decorator but as why EJBHome is not example of decorator.
i might trying little hard to understand.
As you have correctly said that container will wrap services like Security and transaction around EJBObject will provide dynamically exatra resposibilty with actual bean.
this can be true to EJBHome also because EJBHome also gets wrapped with additional functionality like security.
I hope you can understand my doubt.
Regards,
Jigar
SCJP2<br /> <br /><a href="http://www.primeguru.com" target="_blank" rel="nofollow">Share Your Personal Experiences</a>
Originally posted by James Clark:
There are a few major differences between the Proxy and Decorator object-oriented design patterns. In the lastest version of the Enterprise Javabeans API, the EJBObject class is no longer used.
When talking about the older versions of the EJB API, EJBObject was an implementation of the Decorator pattern. Code of the EJBObject added additionall functionality to the actual bean class. It "decorated" the bean class with additional functionality. EJBObject did not serve as a Proxy and was never used as a "stand-in" for the actual bean class.
Either way, the EJBObject was deprecated.
Rodrigo Cunha<br />SCJP, SCWCD, SCEA5(I)
It's feeding time! Give me the food you were going to give to this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
|