Understanding the basic MVC and MVC2 in Java
-
Upload
menghok-heak -
Category
Software
-
view
150 -
download
2
description
Transcript of Understanding the basic MVC and MVC2 in Java
Understanding Basic of MVC and MVC2(Model 2)
2
Who are we?
• Heak Menghok (BBU)
• Chheng Udam (BBU)
• Khoeurn Saksonita (NU)
• Vaing Muny (NU)
We are currently trainees in Korea Software HRD Center.
3
Korea Software HRD Center?
Korea Software HRD Center
is an academy for training software
professionals in cooperation with
KOICA (Korea International
Cooperation Agency) in Phnom
Penh, Cambodia.
Year-4 or Higher in IT.
Under 35 years-old.
Able to study 8 am - 5 pm.
Interested in IT technology
and Korean culture.
90 Students
Each year
Open in
2013
Free charge training
Free all materials
Free lunch
Scholarship
To be Number 1 IT Training in Cambodia
4
Where?
No 12, st.323, Boeung Kak II, Toul Kork, Phnom Penh, Cambodia.
023-991-314, 077-771-236, 015-455-552, 097-978-1555
https://www.facebook.com/ksignhrd
http://www.kshrd.com.kh
5
Activities
6
Achievement
7
What is MVC?
• A software architectural pattern for implementing user interfaces.
• Separated into 3 parts – Model, View, Controller
• Each part is responsible for different task
MODEL(Managing the data of the application)
User
VIEW(Output representation
to user)
CONTROLLER(Getting user’s
command)
displays
uses
Datasource
8
MVC is not Design Pattern?
MVC
Model View Controller
MVC 2 – Model 2
Model View Controller
…MVC – Model 1
Controller
Model
View
9
Advantages
• Independent Model
• Reusable without modification
• Enhancing maintainability, extensibility and testability.
• Works manipulate
10
Model 2
MVC 2 – Model 2
Model View Controller
MODEL(Java Bean)
[*.java]User
VIEW(JSP File)
[*.jsp]
CONTROLLER(Servlet)[*.java]
displays
send request
12
34
5
Datasource
11
Advantages
• Clean separation of roles and responsibilities
• Easy to maintain and future enhancements
• Works faster
• Different person different task
12
Example Explanation
My duty is adding data
My duty is getting data
(index.bar)
I want to view data
Controller
index.bar?Ok, so go to Get dataGet data
Datasource
Result
Now draw the view using this Result
View
Now I get result so I draw layout like this.layout
Now I can see the data
Model
http://khomrean.com/?p=544