• 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
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Design Approach

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I am new to design and started working on a design for small a we base application.Application is pretty simple.It will read data from database and display as various pdf reports in different formats.So i am thinking of having a baseservlet which is an abstract class containing some concrete methods used in generating PDF,metods for DB activity like getting connection from a Connectionpool(another class responsible for maintaining connection pool)some abstract methods like executeHTTPrequest which will be implemented in each servlet associated with a one report.In this function i will form the SQL and construct the pdf and display.
Suggest me whether my approach is ok or i need to think in a different perspective.
Regards
Radha
 
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why not have a single concrete servlet that calls different beans (either descendants of a single abstract class or implementors of a single interface) based on the requested report?
You could send the output of those beans either directly back to the browser or to some other means (maybe another servlet) for output.
That would more cleanly implement an MVC style architecture.
 
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Since this is a simple application, I don't see any reason to go for pure MVC approach.
I think approach used by Radha MahaLakshmi is fine.
But since servlets are a big burden on web server,why don't you use a controller servlet and pass different requests to different plain java classes. Maintain the inheritance in these java classes.
 
Ranch Hand
Posts: 3404
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think you should start simply but consider future requirements, where MVC decoupling helps maintain the application. Most applications tend to grow as new requirements are asked for.
regards
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic