Secondly, when being inserted into a team of people already madly coding away, nobody has the time to give you the lay of the land. So I spent at least a couple days looking a existing code to figure out what I need to do to make my code fit in with everything else. It all seems highly inefficient and a waste of my time and their money. Maybe when you consider just one developer, it may not seem like much but multiply a week of time for every new developer who walks through the door then it's easy to see a pretty big opportunity to save. Do the math with let's say 20 developers and you soon start to think "I could probably build a lot of stuff in 20 weeks".
Anyway, I did manage to build a single web page this past week. But what really impressed me was the number of files I needed to create/edit to enable this one page. I created:
- a domain object with Hibernate XDoclet annotations
- a DAO interface
- a Hibernate DAO implementation
- a DAO unit test
- a Service/Facade interface
- a Service implementation
- a Service unit test
- a JSF backing bean and a JSP page.
- an application resources properties file (despite the fact localization is not a requirement)
- two Spring XML files
- a JSF config XML file and
- added some XML to the tiles definition file.
In my last job, where I made the decisions about architecture and technologies, I had:
- XDoclet annotated domain objects (which included named queries)
- NO DAOs (I felt that the Hibernate abstraction and named queries were a sufficient data access layer)
- Service Objects (typically singletons with explicitly coded session and transaction management)
- XDoclet annotated Struts Action/Form objects + JSPs
- the typical smattering of JUnit test classes.
Having worked with a variety of people over the years I know there are those who believe that elegance is expressed with simplicity. Look at E=mc² for example. And then there are those who love to wallow in complexity. I love simple, efficient, elegant designs. I'm not sure I've found that here... Not yet anyway. Maybe I'll come to love it over time (my fingers are crossed).
Finally, let me comment on a couple of my statements in earlier posts:
- There is a simpler way to integrate Spring and JSF so that you can inject Spring configured beans into JSF managed beans. Using Spring's org.springframework.web.jsf.DelegatingVariableResolver configured within your faces config makes it all transparent. Yay! It may not be as good as using only one dependency injection framework but it's a good runner up.
- Secondly, you can integrate tiles into JSF by configuring org.apache.myfaces.application.jsp.JspTilesViewHandlerImpl in your faces config file.
- Finally, I read Spring's documentation a little more closely and it appears you can use HibernateTemplate's execute method to call whatever Hibernate code you want. So I can now feel free to use that lovely Hibernate API all I want! ;-)
1 comment:
There is a simpler way than using Tiles (and JSPs for that matter) - Facelets: Tapestry-style XHTML templating for JSF.
Post a Comment