Which is the best domain layer option ?


EJB design: Which is the best domain layer option ?

  1. Which is the best domain layer option ? (6 messages)

    Can anyone help me out which is the best solution and why ? I want to use session facade as a service layer and cmp as a persistent layer. Also i dont want to mingle domain and persistence in one BMP as my domain logic is quite heavy.

    session facade + java Objects + cmp
    session facade + java objects + hibernate
    session facade + bmp + cmp
    session facade + stateless + cmp
  2. You could use BusinessDelegate + Session Beans + CMP

     This is a solution that we are using and it's working quite well. You could put all the business logic inside the session beans and the BusinessDelegate classes delegate the calls from the client to the session beans.
  3. depends upon your needs i think....

    we're implementing a rather complex system right now using approach 2:

    session facade + java objects + hibernate

    In my opinion, it's easier to effectively model a complex business domain using java objects than with entity beans. If you have complex logic and relationships between business entities, I would advise going the java objects route.

    Secondly, Hibernate is proving to be highly scalable and performant, while at the same time reducing development effort. Makes a nice fit if you build your
    domain model with pojos.

    So, basically, if you have high domain compexity and demanding scalability requirements, this is, in my opinion, the better way to go. In fact, I would probably go this route in any case, but of course if your requirements aren't too complex/demanding, it doesn't matter as much.

    Additionally, if you have requirements that demand component distribution, there are other complexities to consider.

  4. My Domain is bit complex and also need component distribution. So in this case what are the complexities to consider and what will be the best approach here again. And what if its a model like i need to handle and process many traps from the bottom up approach and then send it to the clients.
  5. You need component distribution across physical servers? If so, you need to consider your approach to cacheing and state management, which will be significantly more complex in this scenario. Of course, best is if you don't maintain server side state in your domain model/ejb tier.

    As for error handling, it depends a bit on your client side architecture...whats your question specifically?
  6. None of the three.

    session facade + java Objects + DAO
  7. of course, DAO and Hibernate are not mutually exclusive...DAO adds a layer of abstraction between the domain model and the persistence implementation...in our case, we do implement the DAO pattern, but our underlying persistence implementation is via Hibernate....

    convenient should we need to change, or should certain operations need to be via straight jdbc (or other)....