The Source for Java Technology Collaboration
User: Password:



Simon Brown

Simon Brown's Blog

Comparing webapp frameworks : Domain model

Posted by simongbrown on November 09, 2005 at 04:21 AM | Comments (1)

Before we kick off our look at webapp frameworks, let's establish the domain model we're working with. It's pretty simple - blogs and blog entries, residing in a package called domain.

Domain model : BlogService, Blog and BlogEntry

Because I want to concentrate on the presentation aspects of the frameworks this time around, I'm ignoring the persistence mechanism. Instead, I'm just assuming that data access will be achieved via a "service", regardless of whether it uses direct JDBC, a DAO, a web service, Hibernate, etc.

So that's the model. The question is, will any of the frameworks or view technologies require us to change it?


Bookmark blog post: del.icio.us del.icio.us Digg Digg DZone DZone Furl Furl Reddit Reddit
Comments
Comments are listed in date ascending order (oldest first) | Post Comment

  • Are you going to use a services (aka lightweight) container (aka factory) like Spring to manage your business services, and provide an interface to locate those business services in a consistent manner?

    Most recognized web frameworks including Struts, Spring MVC, Webwork, Tapestry, Rife, JSF all integrate with Spring these days.

    If you don't use a container like Spring to host your BlogService, how is your web-tier going to locate a configured BlogService implementation? A custom singleton, or a custom factory I would assume. Going that route means some custom code any way you slice it. For your trivial case it won't be much now; however, once your BlogService implementation starts turning into a real subsystem with other dependencies things may begin to break down.

    Spring MVC, because it leverages Spring's container to manage web-tier services like Controllers and ViewResolvers, is the one of the few frameworks above that natively supports dependency injection in the web-tier. This means your web-tier objects don't have to go "asking for" what they need, the container "hands them" what they need -- and that reduces coupling, particularly if what they are handed (through a setter or constructor-arg) is a reference to a business interface.

    Keith

    Posted by: kdonald on November 09, 2005 at 05:22 AM





Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds