Announcement Announcement Module
Collapse
No announcement yet.
How to benefit from Spring and Hibernate w/o a domain model? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to benefit from Spring and Hibernate w/o a domain model?

    Hi all,

    We have an application where almost all the operations are form based inputs and outputs. We use form beans as our primary objects, because our objects do not have any behaviour and they are almost sama as their relational counterparts. We do not keep relations between objects with references, with just db ids (and ids are also in form beans). As you can see a horrible architecture! However, it works for our application's nature.

    Now, is there any aspect of Spring and Hibernate where we can improve our application? (I think we can use aop logging, replace jdbc with ibatis or spring jdbc at least.)

    Thanks in advance.

  • #2
    Neither Spring nor Hibernate imposes a domain-driven architecture (although they promote it). You can have DTO's mapped to tables, use Hibernate to do all the data accessing, and use a stateless service layer (managed by Spring) for all the navigation between objects.

    Comment


    • #3
      Two questions

      I need some more clarification.

      1. Could you please explain the Spring's value for Stateless Service Layer?

      2. How can Hibernate help with objects like

      Code:
      public class Employee {
         private Long id;
         private Long departmentId;
         private String name;
         ...
      }
      
      public class Department {
         private Long id;
         private String name;
         ...
      }
      All relations are constructed with DB ids. Does Hibernate provide any benefit here?

      Thanks in advance.

      Comment


      • #4
        Any answer please?

        Comment


        • #5
          Hi Ersin,
          You are asking very broad questions and you might find that people are hesitant to respond because it would take to long...

          Check out this presentation given by Rod Johnson at last years Javapolis conference. Among other things he covers the benefits of spring's service (middle tier) layer. Also check out Expert One-on-One J2EE Development without EJB for the theory behind Spring and Pro Spring for practical examples.

          As for Hibernate, I strongly suggest reading Hibernate in Action, Christian and Gavin do an excellent job of explaining Hibernate and ORM in general. Also, check out the section on associations mapping in the hibernate docs.

          Cheers,
          Dan

          Comment

          Working...
          X