Tuesday, August 5, 2008

MVC model for doing software projects


MVC MODEL

In general any software Industry want to do projects in mvc architecture.But what it actually

is Model View Controller architecture.In this you find three new words,here below i am explaining clearly about those terms.

  • Model means Buisyness Logic .It includes actual logic in working project. This adds meaning to raw
    data.(Ex: calculating whether today is the user's birthday, or the totals, taxes, and shipping charges for shopping cart items).
  • View means GUI(Graphical User Interface) in your project i.e. what you are giving user to interact with your project.(Ex: yahoo login page in yahoo website,searching text field in google website etc.)These includes JSP(java server pages),HTML pages,etc.
  • Controller means Action Servelets for controlling your whole project from one part to another part.Using this controller anyone's project will run from initial user interaction to storing details into database(if needs).(Ex: In yahoo site user enters his details ,this controller will take that details and forward to action,from action to form,from form to service,from service to DAO(Data Access Object) etc.) You will clearly know about these highlited terms below.
Buisyness Logic means actual logic in the software or project which you are trying to build i.e. if you want to write login action,in that you need to check the user entered data is valid or not? So,for that you need to write logic,that logic is called as buisyness logic.It acts as an interface between Data Access Layer and Action Class.

Data Access Layer
means it is the layer which contains methods to access data from DataBase. It has the direct access to database(i.e. inserting data into database,updating data in the database,retrieving data from database etc.).For this generally we use "Beans" which contain the required feilds,their Getters and Setters. SPRINGS is one of the technologies used to write logic of Data Access Layer.

GUI means graphical user interface which containls the actual LOOK and FEEL of your project.It contains the UI screens with which user can avail the services of your project.For example you want to search for some article in google then you need some interface to enter your idea to be searched that is what ,which attracts people to click Your site after that only. you need is it working perfectly or not? So GUI is very important for any project.There are several technologies to write the logic of GUI.In that some of them are JSP,HTML etc.

Controller is the one which controlls all actions ,works of your project.It manages the whole layers of your project.From the starting i.e. accessing the details entered by user to accessing the database(i.e. inserting ,deleting,updating,retrieving etc.)In contrller Action Servelet is one which intializes the running of your project.

The following diagram gives you some description about this model.