EJB Command pattern


EJB design: EJB Command pattern

  1. EJB Command pattern (2 messages)

    Hello All,
    Can anybody explain me what is EJB Command pattern I have read the book EJB design Patterns but I am not able to understand it.
    If possible if an example can be given it, will be of greate help.

    Alok Garg

    Threaded Messages (2)

  2. "EJB Command Pattern"[ Go to top ]

    " In plain programming terms whole code witten in entity bean are written in java beans.SLS beans contains some required bussiness logic methods.
     In entity beans it just calls the mthods in java bean.It really improves performance in this way.
     EJB Command pattern advocates placing the business logic in light weight java beans.The main
     advantage is complete decoupling of client from EJB and the execution of the use cases in one network call and transaction.
    It does this by providing clients with classes that they interact with locally,
    but which actually execute within a remote EJB server,transparent to client.
    Commands are used to encapsulate individual units of work in an application like placeOrder etc.
    The clients interaction with command is very simple.
    Once the clients gets command(from factory or other) it simply set's attribute onto the command.
    when the client excutes the command,instead of executing locally,command is actually transferd to remote EJB server and executed within the remote EJB server.
    In this way it executes a use case in a single trnsaction.Benefits of Command pattern are
    !0Facilitates Rapid action development,seperation of businees logic from presentaion logic.
    Hope this helps you,If not cleared plz feel free to revert back
  3. why use command[ Go to top ]