+ All Categories
Home > Technology > 2015 UJUG, MVC 1.0 portion

2015 UJUG, MVC 1.0 portion

Date post: 17-Jul-2015
Category:
Upload: mnriem
View: 625 times
Download: 0 times
Share this document with a friend
Popular Tags:
26
MVC 1.0 Manfred Riem (@mnriem) Oracle Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Transcript

MVC 1.0

Manfred Riem (@mnriem)Oracle

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Safe Harbor Statement

The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.

M

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Agenda

MVC

MVC 1.0 JSR

Some examples

MVC tooling

Questions and Answers

1

2

3

4

5

E

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

What is MVC?

• MVC is a pattern used to implement a user interface (UI).

• It consists of 3 major components

–Model (M)

– View (V)

– Controller (C)

• Each of the components has a distinct responsibility which is covered in the next slides

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

The M(odel) in MVC

• The model is the interim state you want to keep when you are building an application that shows a user interface

• Examples

–Who is logged in

–What are they trying to buy

–What page are they on in a multi page flow

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

The V(iew) in MVC

• The view is what your user interacts with

– In a web application that would be the web page or web pages• your JSP page

• your CSS styles

• your JavaScript

– In a thick client scenario it would be the entire UI

– In an embedded scenario it could be the touch screen, hardware buttons etc.

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

The C(ontroller) in MVC

• The controller is the work horse of the pattern, as it:

– Executes the business logic• Run a credit card transaction

– Updates the model• Mark the transaction as successful in the model object

– Ask the view to render itself• Shows the transaction was successful

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Different styles of MVC

• Component-based MVC

• Action-based MVC

• Other styles

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Component-based MVC

• A specific style of MVC made popular by component frameworks

• Controller provided by the framework

• Some examples

– Java Server Faces (in the JavaEE platform)

– Seam (discontinued)

–Wicket

– Tapestry

– Apache Click (retired)

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Action-based MVC

• Controller(s) defined by the application

• Currently no JavaEE implementation

– Good news we are creating one!

• Some examples

– Struts 1 (end of life)

– Struts 2

– Spring MVC

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Action-based MVC

–Manual request parameter processing

– No view kept around

– Limited support for re-usable behavior

– Developer responsible for all HTML / JavaScript

– No automatic input conversion

– No automatic input validation

– Request centric

Component-based MVC

– Automatic request parameter procession

– View kept around

– Component libraries that implement re-usable behavior

– Components render HTML / JavaScript

– Automatic input conversion

– Automatic input validation

– Page centric

Compare and contrast

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Agenda

MVC

MVC 1.0 JSR

Demos

Recap

Questions and Answers

1

2

3

4

5

E

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

The MVC 1.0 JSR

• It really is the “Action-based” MVC 1.0 JSR

• Where it this coming from?

– JavaEE 8 survey

– Talking to our customers

– UI landscape is not one size fits all

• Who is supporting it?

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

List of supporters

• Joshua Wilson (Red Hat)

• Woong-ki Lee (TmaxSoft)

• Josh Juneau

• Fabio Velloso (SouJava)

• Yara Senger (SouJava)

• Bruno Souza (SouJava)

• Markus Karg

• Antonio Goncalves

• Rajmahendra (JUGChennai)

• Francisco Sokol

• Werner Keil

• Martijn Verburg (London Java Community)

• And of course Oracle

(see JCP page)

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Where and how?

• Where are we at?

– The first Early Draft has just been published

–Our first Milestone release is available

• How can I help?– Join the [email protected] mailing list and comment

– Participate in the Adopt-a-JSR program (JUGs)

– Test out milestones / snapshots from the RI website (http://ozark.java.net) and file issues if something is not working

– Tweet, blog, socialize to raise awareness about MVC 1.0

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

An example about the EG process

• How are we going to protect against Cross-Site Request Forgery?

• Since the [email protected] mailing list gets every mail the EG sends you can follow all the discussions happening

• What do you think?

– Tell us on the mailing list

– Tweet about it

– Talk to me after the session

• Why do I ask?

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Agenda

MVC

MVC 1.0 JSR

Demos

Recap

Questions and Answers

1

2

3

4

5

E

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Demos

• Switching gears and showing you where we are at!

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Agenda

MVC

MVC 1.0 JSR

Demos

Recap

Questions and Answers

1

2

3

4

5

E

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Recap

• Doing MVC now is not a bad idea, because we are:

–We are leveraging CDI

–We are leveraging Facelets

–We are delivering an easy migration path if you are using JSPs

–We will be leveraging Servlet 4.0 (ServerPush)

• Can you get involved? Yes, how:

– Join our users mailing list

– Tweet about MVC

– Blog about MVC

– Test out SNAPSHOT and milestone builds from https://ozark.java.net

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Recap (continued)

• View Engines

– JSP

– Facelets

– FreeMarker*

–Mustache*

– Thymeleaf*

– Velocity*

– Handlebars*

* Delivered and supported by MVC community, not required by the MVC specification

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Links

• MVC specification

– Website http://mvc-spec.java.net

– Users Mailing List [email protected]

• MVC implementation

– Website http://ozark.java.net

– Users Mailing List [email protected]

• Spec leads

– Santiago (@spericas)

– Manfred (@mnriem, https://www.java.net/blogs/mriem, http://mvc.zeef.com/manfred.riem )

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Questions?

• Ask them now

• Talk to me afterwards


Recommended