Java Object Strategy
The ValueListHandler can be implemented as an arbitrary Java object. In this case, the ValueListHandler can be used by any client that needs the listing functionality. For applications that do not use enterprise beans, this strategy is useful. For example, simpler applications may be built using servlets, JavaServer Pages (JSP) pages, Business Delegates, and DAOs. In this scenario, the Business Delegates can use a ValueListHandler implemented as a Java object to obtain list of values.
Stateful Session Bean Strategy
When an application uses enterprise beans in the business tier, it may be preferable to implement a session bean that uses the ValueListHandler. In this case, the session bean simply fronts an instance of a ValueListHandler. Thus, the session bean may be implemented as a stateful session bean to hold on to the list handler as its state, and thus may simply act as a facade (see "Session Facade" on page 291) or as a proxy.
Petstore does seem confusing... I think that what Petstore calls the Web Controller is actually the BD, and the EJB Controller is the facade. The point of this BD is that it simplifies access to services on a different tier, i.e. allows the web tier to access the session facade and POJOs on the business tier.
Another point... the diagrams showing VLH are (over?)simplified as they only show what happens in that particular pattern, not the patterns it relies on such as BD, or the relationships between them. So when you see "Client" in the Petstore Catalogue diagram, IMO it just means any incoming call from the client's direction, which could be from a BD or a JSP or anything.
CLUCK LIKE A CHICKEN! Now look at this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
|