Results 1 to 4 of 4

Thread: Web layer, how complete Model

  1. #1
    Join Date
    Mar 2005
    Location
    Prague, Czech Republic
    Posts
    34

    Default Web layer, how complete Model

    I've got a problem designing a web layer of my recent application. I used Struts and later Spring MVC on my projects last year, but these project weren't too complex so the design "one page, one controller" was sufficient.

    Now I feel I need more sophisticated approach. What is the problem? The pages of my application are going to be rich. The page will contain not only the "main" thing (table of users, form, etc.), but also other components requiring dynamic processing (last logged in users, best selling products, etc.). I my current way of development these components would mean adding neccessary data to the Model in each controller for a page in which this component is used. This means repeating myself again and again. And what if I decide to change a component for another or add this "tiny table" to 10 pages?

    Do I miss some important design approach or a suitable open-source framework? This problem has to be so common I know many of you solved this before? Declarative pages? XML?

    Thangs a lot.

  2. #2
    Join Date
    Aug 2004
    Location
    Melbourne, Australia
    Posts
    1,104

    Default

    my current way of development these components would mean adding neccessary data to the Model in each controller for a page in which this component is used
    You can use inheritance to add the common model data, or just add it to the web application scope.

    And what if I decide to change a component for another or add this "tiny table" to 10 pages?
    You can look at Sitemesh or Tiles or alleviate this problem,

  3. #3
    Join Date
    Mar 2005
    Location
    Prague, Czech Republic
    Posts
    34

    Default

    Thanks. I know about Tiles and Sitemesh. Btw. has someone used Tiles controllers (controllers for tile definition) managed by Spring?

  4. #4

    Default

    I use Sitemesh and a HandlerInterceptor for exactly that, and it works quite well, when the stuff you want to display additionally to the main content is not very different on each site.

Similar Threads

  1. Spring-based architectural approach
    By diegum in forum Architecture
    Replies: 9
    Last Post: May 10th, 2007, 04:09 PM
  2. One ApplicationContext per Layer problem...
    By Alwin in forum Container
    Replies: 2
    Last Post: Jul 7th, 2005, 10:49 PM
  3. planning major migration to spring
    By wexwarez in forum Architecture
    Replies: 21
    Last Post: May 23rd, 2005, 01:13 AM
  4. Content Provider vs View Model
    By Martin Kersten in forum Swing
    Replies: 21
    Last Post: Mar 10th, 2005, 02:25 PM
  5. EJB service layer non-OO / Anemic Domain Model
    By Aro in forum Architecture
    Replies: 0
    Last Post: Jan 15th, 2005, 07:10 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •