Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

MVC (Model View Controler)

nassernasser Member Posts: 1
has anyone use this model for java developpement? i need some infos for developping something, but i don't really understand how to use the model. thanks

Comments

  • treshrtreshr Member Posts: 326
    I've used the J2EE MVC Model.

    I've used to control the queue of a webcam.

    It works like this.
    You have a Model, that is the class that takes care for all kinds of actions.
    You have a view, that only shows the info and does nothing more than that.
    You have a controller that gets requests from a view and sets them to actions that can be send to the model.

    I'll explain it with the application that I created.
    I have a controller, that is a servlet, everytime someone wants to control a certain camera it has to go through the servlet.
    The servlet checks upon a certain parameter.
    If the user doesn't have a parameter, it refers the client to a view (there is you view) that contains all the camara's.
    If the client has a camera parameter, it checks in the actual queue(that is the model, ans is java application) if the client is already in the queue, if he's the first in the queue etc etc.

    So you see, the controller sets requests into actions for the model.
    The view only shows some information and the model takes care that everything goes alright.

    if you want more information go to this page. It helped me to figure out
    how the MVC model worked.
    http://java.sun.com/blueprints/patterns/MVC-detailed.html

    Hope this helps, success.

    --=][tReShR][=--

  • brahmanbrahman Member Posts: 2
    ya whatever treshr has written is correct.
    the main thing that need to be looked in this modle is the
    OBJECT, ACTION and the CLICKEDVALUE that are passed between the controller and view.
    The login part remains in the modle and all the fron tend in the view so the things are very sophisticated and smooth to work on.
    I am using this architecture in my current application so if u have nay other query please share it.
    bye for now
    brahman
  • arb123arb123 Member Posts: 696
    You might want to look at JavaServer Faces - on http://java.sun.com

  • pulsariopulsario Member Posts: 8
    Have you had a look at the Apache struts framework. It is a very good example of true MVC architecture. Check out the Apache site for info. It is a bit complex to begin with but it truely separated the code (model) from the view (jsp's) and is controlled by an xml servelet (controller). Struts contains inbuilt data validation and simple internationalisation capabilities. Worth a look.
    Cheers
Sign In or Register to comment.