views:

261

answers:

4

We're developing a webapp using GWT 2.0(not to AppEngine), Spring and Hibernate and trying to jumpstart by auto-generating as much code as possible.

I've looked at http://stackoverflow.com/questions/1963672/spring-roo-vs-appfuse-generate-service-dao-layer. I tried appfuse but that did NOT work for me; Also, roo for GWT is not quite there yet since it's a Milestone release.

If a tool can generate the Service Layer and DAO layer for me, I should be able to do the actual business logic and UI wiring -- although it appears that if I'm willing to wait for another 6 months, the current 1.1M1 version of Roo can get me there, but I need to get something going right away.

Any suggestions ?

Thanks much

+2  A: 

I haven't used it myself, but Firestorm/DAO looks promising...

Albert
Thank you.I was looking fora) domainb) DAOc) Service layers to be generated by the tool. Firestorm can do only DAO.
anjanb
Come to think of it, I've also done this in the past with Oracle's proprietary ADF framework. I wouldn't advice using ADF, but it is very capable of generating DOA and service layers based on an existing database with hibernate/toplink. (You would need to use JDeveloper for generation part). Might be worth investigating...
Albert
+1  A: 

AppFuse and Spring roo in their current versions should provide sufficient features to generate the desired code.

As you want to generate the Service and Dao layers, there is nothing GWT-related here.

So give AppFuse another try, or ask a question about your concrete problems with AppFuse.

Bozho
+1  A: 

What about Grails and it's GWT plugin then?

Pascal Thivent
Thanks!That won't do the trick. I had suggested Rails but that was NOT considered *yet* to be "popular enough". Grails might have a better chance but the community is not as good as Rails or Plain Java. So, probably, I might NOT be able recommend "Grails and GWT" combo.Thanks anyway!
anjanb
@anjanb: I can understand that. Thank you for your feedback and good luck anyway!
Pascal Thivent
+1  A: 

From my understanding of a service layer I don't know how you would generate that; if written properly it should be very much based on your business model, and shouldn't follow your database schema much at all. Unlike a DAO (arguably, I actually don't have DAO's one to one entity all the time either), you shouldn't have a service for every entity, instead your services should either use entities as part of their API to perform units of work, or supply business objects that are an abstraction layer between the controlling logic and data access. It can also be a hybrid of both. This depends on how complicated the application is, and how closely related your DAO/Entities are to your database.

EDIT: Based on your comment, and the great rush, I would use the tools mentioned in other posts to generate your DAO layer, that will give you a very good start. Then I would create a single Service object that holds all of your DAOs. From there, you will have access to do all your business logic in a testable container (the service object). This will keep you from putting it in the controllers, and will give a single place where people can see all the business logic methods. As it grows you will see the redundancies, and the logical units that you could later seperate into different service objects.

Hopefully you will have the time to do so, but when I'm in a huge rush, I like all of my business complexity to be in a single service object, as opposed to many controllers. The refactoring you do later will be much easier. And you can still easily test methods, which I'd recommend regardless of the rush, trust me, it's faster to write tests on service methods than test them by deploying, and checking.

walnutmon
we're in a great rush to get something deployed. In general, most of what you say makes sense. Given the rush, I want something up and running without much debugging. The defects can be fixed later(tech. debt). What I really want are the DAO, domain objects, config(annotation) to be generated given that the DB Tables/Views are done. Hope that makes it clear ?
anjanb