• 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

Action Implements ModelDriven interface

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

I have couple of doubts in struts-2.

First one: MVC here, Controller is black-box which hands over to struts.xml, View is jsp and Model is Data and which retrieves the data from DB. i.e Model and Business services.
Model which contains set of variables with setters and getters. For this Model class some people call as Beans. Which is the proper name for this, Model or Bean? If Bean the why we implements ModelDriven interface why not BeanDriven?

Second : Suppose if I have 100 methods in my single action class instead of creating 100 actions. Also I have 100 Model (Beans) which contains same member variables and having different class names i.e Customer1 to Customer100. for example,



Now I want to implement ModelDriven<?> in my single action class. Obviously I want all 100 Models (bean) in my single action class which contains all 100 methods with different logic. Now how to implement ModelDriven<?>. I cant set all 100 Models here . I mean which Model I have set in generics place?

Thanks:
Ramakrishna K.C
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ramakrishna Udupa wrote:Which is the proper name for this, Model or Bean? If Bean the why we implements ModelDriven interface why not BeanDriven?



"Bean" is a Java term. "Model" is the software architecture term.

Second : Suppose if I have 100 methods in my single action class instead of creating 100 actions. Also I have 100 Model (Beans) which contains same member variables and having different class names i.e Customer1 to Customer100. for example,


Why would you ever do this? If two objects have the same properties, they should have the same declaration (i.e. they're the same "class").
reply
    Bookmark Topic Watch Topic
  • New Topic