Jan 13th, 2011, 11:04 PM
Developing reusable modules using Spring and Tiles
I would love to get your feedback on the architecture below. I am developing a website using Spring/tiles. The pages of the site contain various modules (up to 5 modules per page). For instance, there is a module called 'Recent Posts' or 'Featured Content'. Each page includes one or more of those modules and the same module can be included by one or more pages.
I am thinking of implementing it this way:
Each module will be implemented as a Tile generated by a ViewPreparer (e.g. recentPostsModule is generated by RecentPostsViewPreparer). The ViewPreparer will be using a Manager class (e.g. RecentPostsManager) which will use RecentPostsDAO to produce results. The tile can take config params if different pages using that tile need to customize that tile (e.g. the homepage will ask for 5 recent posts and some other pages will ask for 10 recent posts.
Can you think of a better approach to develop reusable code modules?