• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Design question?

 
Ranch Hand
Posts: 782
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

In models like MVC and STRUTS (framework), there is a good separation of presentation, busniess and persistence layers. Sometimes a developer wants to do some operation on the data fecthed from persistence layer and then pass it to the presentation layer. Question here is that, in which layer this operation is prefered to do?

In other words:

1: Fetch 100 records from database and save each record in a collection.
2: Call that collection in presentation layer (in JSP) and display the record in tabular format.

Now before we save each record in collection, some operation is to be done on each record. Means, 1st do some operation on a record and then save it in collection. After saving all the records in a collection,pass that collection to the presentation layer, normally JSP.

Bye,
Viki.
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Data manipulation per business rules generally belongs in the model. The model can retrieve data, perform calculations or transformations and pass it along to the requesting presentation.
 
reply
    Bookmark Topic Watch Topic
  • New Topic