Announcement Announcement Module
Collapse
No announcement yet.
xDoclet in Spring Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • xDoclet in Spring

    Hi all,

    In your opinion is it better to hand author the spring config xml files or use xDoclet?

  • #2
    I think using xdoclet is the wrong approach. XDoclet is about metadata and its initial goal was to get rid of the big, ugly and redundant EJB 2.x xml configuration files.
    That's not the situation with Spring - Spring is all about Inversion Of Control - i.e. your classes are not aware how the wiring is made or who manages them.
    This is a subtle yet very important concepts as it greatly simplifies and enhances your code (see the red books for details on the concept and how does it apply).
    Spring xml files are not redundant, repetitive or complex - doing then 'by hand' is, at least for me, the easiest and simplest way to configure an application. I would argue that in the end you'll write a lot less using directly Spring XML then by using XDoclet.
    Using tools like SpringIDE offers a nice configuration view and help with editing.

    Comment


    • #3
      I agree with Costin. Wiring up the spring beans by hand is very easy, mostly is is write once, use everytime . With EJB's you had to edit more then 1 xml file to make 'the magic' work.

      And indeed a tool like SpringIDE greatly simplifies the configuration (code completion within your xml files, validation etc.)

      Comment


      • #4
        Thanks guys for your opinions

        Thanks a lot guys. I was also thinking along those lines.

        Comment


        • #5
          What about Hibernate?

          Originally posted by Costin Leau
          Spring xml files are not redundant, repetitive or complex - doing then 'by hand' is, at least for me, the easiest and simplest way to configure an application. I would argue that in the end you'll write a lot less using directly Spring XML then by using XDoclet.
          Convincing. Would you say the same goes for Hibernate mapping files?

          Comment


          • #6
            In my opinion, classes are concerned just with java code. But that's just my opinion - some might be very glad to have annotations or metadata inside their code - I'm not.
            Think for example of sending pojos over the wire - the third parties suddenly needs to have all your class dependencies - that's okay when these are just your packages but once you add in annotations things start to get messy.
            The metadata/xml thing was debated a lot and it depends to some degree to developer preferences and use cases.

            Comment

            Working...
            X