Announcement Announcement Module
Collapse
No announcement yet.
Appropriate to use Spring with a standalone java app? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Appropriate to use Spring with a standalone java app?

    Hi,

    I'm implementing database functionality for a legacy java app that previously had none. I've been looking for a framework/app that will handle the repetitive low level JDBC stuff like creating connections, iterating through recordsets and populating objects with data from the database, etc.

    I happened upon Spring and am curious if I can use it in this manner, or is it more geared towards web type apps, running wihin the context of an application server?

    Would Spring be a good candidate for my needs? My database schema is not very large or complex at all, not more than a few dozen tables, with proper referential integrity, and not many primary/foreign key relationships. All I'm looking to do within the java app is basic CRUD operations on the databse. Nothing too fancy.

    Would another solution work better for a standalone app? I've also been looking at Hibernate, Ibatis SQL Maps, and Cayenne. My #1 requirement at this point is simplicity since I don't have much time to invest in learning a massively complicated framework with many features that I won't need or understand.



    thanks for your help!

  • #2
    Applicability?: Spring is very applicable. I'm using it in that manner. Also used it to create an embedded custom DB.
    Simple?: I think its simple to some extent for that purpose.
    CRUD?: Its JDBC abstraction layer does help and does get rid of all that jdbc noise without one having to code a custom abstraction class. And, when needed it also supports ORM.
    complex?: As complex as one wants to make it. Spring is only dependent on one external jar, but then grows from there based on what you want to do. The claim is that Spring's abstraction framework makes using other stuff simpler.

    Comment


    • #3
      Re: Appropriate to use Spring with a standalone java app?

      Originally posted by spovilaitis
      Would Spring be a good candidate for my needs?
      Yes. Migrating a data layer was my first introduction to Spring, and from what I hear in interviews, that is most developers introduction to it.
      Originally posted by spovilaitis
      All I'm looking to do within the java app is basic CRUD operations on the databse. Nothing too fancy.
      ...
      I've also been looking at Hibernate, Ibatis SQL Maps. . .
      Spring supports JDBC, HBM, Ibatis, all out-of-the-box. Write a DAO in ten lines or less. Trust me; once you've had xxxTemplate, you'll never go back.

      HTH

      Comment


      • #4
        Why not?
        Hibernate integration is very cool, and Spring's IoC provides easy configurations, but many depends on your application. If your existing application is well tired, and supplied with unit tests, you'll have no problem in applying Spring's DAO with Hibernate. You just need to create data objects (POJO), annotate it (JDK 1.5) or make xml-mappings, also you'll probably need some unified DAO for accessing your data.

        Anyway I've used Spring in standalone application and it's done well. Next time I'll definitly try Spring's RCP.

        Comment


        • #5
          Thanks everyone for your replies!

          Now, how about a book recommendation See my post:

          http://forum.springframework.org/showthread.php?t=17142

          thanks again!
          Last edited by robyn; May 14th, 2006, 11:40 AM.

          Comment

          Working...
          X