This post originated from an RSS feed registered with Java Buzz
by Fred Grott.
Original Post: A Hibernate Code Generator
Feed Title: ShareMe Technologies LLC-The Mobile Future
Feed URL: http://www.jroller.com/shareme/feed/entries/rss
Feed Description: A Weblog about Java programming and digital convergence on mobile devices in such areas as P2P and collaborative technology.
What if I were to tell you folks that if you follow certain procedures and techniques that you could use the Grails framework as a part of a Hibernate/JPA code generator process? and still have the resulting model intuitive. The main issue is to get the direction of the ownership of the relationships right. Domain user case wise you are attempting to limit or reduce the amount of side trips.
For example, something as complex as a user registration and profile could be a series of stages. What is not apparent until you start digging is that those stages not only reduce the number of one-to-many and many-to-many complex relationships but also match up with the Domain Class and Controllers in Grails and Hibernate/JPA layers.
UML-wise because the domain classes and controller naming does not match naming of the user cases and etc you will not see it in the UML diagrams. For example, lets say we have a company and employees in our model.
What is the Controller to enter new employees into company records? Its a trick question as your views/actions do the action described but s not called that however. Thus, agile wise if you can reverse engineer the database tables for UML why spend time trying to work a UML model that is hard to understand why not just jump right into Grails GORM and hit it?
But it cannot be as simple as reducing cascading down to only one level and etc, right? But, what if it is? Do not take my word for it try it yourself! Think about it Grails as your modeling tool! Get it yet? Now, it does not have fancy drag and drop and etc as found in those UML stylized tools we are so use to but which is more effective? Better yet name one UML tool directly coupled to Hibernate/Spring like Grails..I rest my case.