Understanding the basic MVC and MVC2 in Java

13
Understanding Basic of MVC and MVC2(Model 2)

description

Understanding the basic MVC and MVC2 in Java. This slide is used in BarcampPP presentation.

Transcript of Understanding the basic MVC and MVC2 in Java

Page 1: Understanding the basic MVC and MVC2 in Java

Understanding Basic of MVC and MVC2(Model 2)

Page 2: Understanding the basic MVC and MVC2 in Java

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.

Page 3: Understanding the basic MVC and MVC2 in Java

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

Page 4: Understanding the basic MVC and MVC2 in Java

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

[email protected]

http://www.kshrd.com.kh

Page 5: Understanding the basic MVC and MVC2 in Java

5

Activities

Page 6: Understanding the basic MVC and MVC2 in Java

6

Achievement

Page 7: Understanding the basic MVC and MVC2 in Java

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

Page 8: Understanding the basic MVC and MVC2 in Java

8

MVC is not Design Pattern?

MVC

Model View Controller

MVC 2 – Model 2

Model View Controller

…MVC – Model 1

Controller

Model

View

Page 9: Understanding the basic MVC and MVC2 in Java

9

Advantages

• Independent Model

• Reusable without modification

• Enhancing maintainability, extensibility and testability.

• Works manipulate

Page 10: Understanding the basic MVC and MVC2 in Java

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

Page 11: Understanding the basic MVC and MVC2 in Java

11

Advantages

• Clean separation of roles and responsibilities

• Easy to maintain and future enhancements

• Works faster

• Different person different task

Page 12: Understanding the basic MVC and MVC2 in Java

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

Page 13: Understanding the basic MVC and MVC2 in Java

http://khomrean.com/?p=544