• 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

MVC - Model doubt.

 
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In MVC architecture "M" represents the model, which is nothing but the java class.

Can anything else act as a model? Can Java bean be a model?
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Can Java bean be a model?


Sure, why not? There is nothing magical about a Java bean, its just a class that uses the bean conventions. You are free to code the "model" representation of data any way that fits the rest of your application.

Personally I start with thinking about how the data is saved and restored.

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

MVC denotes Model ( can be Java beans or EJB )
V denotes View ( can be JSP xml and more)
C denotes ontroller (Should be a servlet or struts-config.xml if you are using struts framework)

Model is nothing but business logics..

Regards,
Vijay.B
 
author and cow tipper
Posts: 5009
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your model is your business logic. You want to keep it separate from View generation logic and Controller Logic. But the actual Java artifact that implements the model is up to you. I think you should do it in a JavaBean. Some have done it in Servlets. Others have done everything in a JSP.

And really, don't we all pine for that one, monolithic object, that does everything, sits in the root of C:\, and has one bit method called go() that does everything?
[ August 27, 2006: Message edited by: Bear Bibeault ]
 
He's giving us the slip! Quick! Grab this tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic