This week's book giveaway is in the Java 9 forum.
We're giving away four copies of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications and have Sander Mak & Paul Bakker on-line!
See this thread for details.
Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

MVC implementation  RSS feed

 
Vrinda Werdel
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,
I just wanted to know if what I knew about it MVC implementation is right.
From what I have understood, we design classes that manange the GUI(the view) , define listener classes for all the gui components (the controller, which, effectively intercept the events help us do the task required of that gui component) and finally we have classes that encapsulate the domain data and behaviour.
All I can understand from this is the clean logical separation of responsibilities.
Is this all there is to implementing the MVC? or is there more to it than meets (my) eyes?

Appreciate your responses.
Vrinda
 
Mark Waldrop
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Vrinda,
You idea is pretty much right.
In code that I maintain and develop.. a lot of times the view and controller are combined into one class and then the model (an encapsulation of all your data) is in another class.
Hopes this helps!
Mark
 
james airey
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The way of splitting them up I tend to use is to say "What if I want to distribute this application in 2 formats?".
How much of my code is common, and contains the core functionality? That's the model.
How much of it changes if I change distribution from a website to WAP? That's the view.
The controller sits in the middle.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!