Announcement Announcement Module
Collapse
No announcement yet.
Web layer, how complete Model Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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,

    Comment


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

      Comment


      • #4
        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.

        Comment

        Working...
        X