Presentation is loading. Please wait.

Presentation is loading. Please wait.

Saif Kamaal Java Server Faces (JSF) Next Generation User Interface.

Similar presentations


Presentation on theme: "Saif Kamaal Java Server Faces (JSF) Next Generation User Interface."— Presentation transcript:

1 Saif Kamaal Java Server Faces (JSF) Next Generation User Interface

2 About Me Masters in Computer Applciation from Mumbai University. Software developer for 3 years (2007) Java Web development since 2006 SCJP, SCWCD, Weblogic Certified. Recent projects use JSF- Richfaces, Hibernate, JBoss, Oracle Working on Code Generation.

3 Summary Brief History of JSF. Motivations for JSF, the Java Landscape. JSF details. Demo apps in JSF and Richfaces.

4 How UI Framework originated? Tradition applications were desktop applications based on AWT and then Swing. The origin of internet and increase in the number of clients gave rise to web based applications. Traditional web based applications were written in servlets (still a number of projects are based on servlets). Then came JSP and people said “We have got what we always wanted” – no sooner they realized how wrong they were . Some technologies came here and went like light.

5 Application Development a Layered Approach

6 Why go for a Layered Approach ? strategic separation of different elements each layer is organized to provide support and base functionality to the next easier to solve multiple small problems than fewer big ones mitigates risk of technological evolution value in consistency helps maintenance

7 A Common Layer Stack

8 Benefits of a Layered Approach Change to a different Data Source with minimal effort - through Data Access Layer Add new Deployment Options - e.g. Add a Web Services Layer over the Business Services Layer Storage & Data Structures are independent of the Presentation Layer and so on …

9 Layer Deployments on Tiers Layers reside on the same machine, same runtime and any object visible to one layer can be passed to the other either by Value or by Reference. Tiers could be on different machines or on different runtimes, hence the data has to passed by Value only - as serialized objects.

10 Issues with Servlet In terms of creating a Grapical user interface,servlet is tough to use.Because you have to write huge code to send html text to client. No separation of concern. Java and HTML mix. Change in presentation part also required compiling the whole servlet. And the list goes on….

11 Sample Servlet Code

12 Issues with JSP JSP were created beacause complaints of developers like me and you who were tired of typing out.println(" " + pageInfo.getTitle() + " "); into their servlet code. To solve the problem of separation of concerns but … And so on..

13 Sample JSP Code

14 Saif Kamaal Emirates Group IT Enters JSF Next Generation User Interface

15 What is Java Server Faces? JSF is a spec which defines a component-based MVC framework JSF 1.2 is included in the larger JEE5 spec The spec was developed by involving many people from orgs like Sun, Apache, IBM, Oracle Not tied to a Web framework, nor a thick-client GUI – theoretically could be applied to either Implementations, frameworks: Sun RI vs. Apache MyFaces JBoss Seam vs. Apache Struts 2 Shale IBM, Oracle have proprietary solutions

16 The Problem with Web apps HTML? HTML? Java people like Objects, HTML is not Objects Web programming is more difficult than GUI programming Java programming is hard – and J2EE is even more difficult: Servlets? JSP? EJBs!?! Microsoft has VisualStudio which turns web programming into drag-and-drop, that looks easy! 10 minute demo!

17 Answer: a Framework! (yet another framework, of course) Struts – reduced lines of code, made apps pretty complex, created a niche of skilled Struts mercenaries WebWork – fixed some of the Struts hassle SpringMVC – brought powerful AOP concepts to web dev Tapestry – JSP? dump it, XML rules!

18 MVC WARS any Web apps in 2006 means seeing a mix of Struts, Tapestry, Spring MVC, and Webwork (consultant: which one pays the best?) the battle rages on, who will win? how can you tell who won? Trust Craig? Trust Rod? How can a OSS project define victory? Converting legacy apps: Struts is dead! long live Struts 2 Action and Struts 2 Shale!!! How can I possibly pick one for a new project, when the technology is under attack?

19 JSF to the rescue Make Committees, Not War! get the big players together to solve MVC problems in a standard way, argue, compromise, repeat... publish final Spec Use components, not actions, more like Swing, less like Struts Set a standard so we can build derivative products like IDEs with drag-n- drop ease, without worrying about change The differentiator that JSF brings, which other similar frameworks do not have, is the backing of a standard specification (JSR127). Because JSF is part of the J2EE standard specification, it is a top priority for every major J2EE tools vendor in the market (including Oracle, IBM, Borland, and Sun) to support it, which in turn will guarantee a wide adoption and good tools support. and the main objective...

20 We will hit the target !!!!

21 3 Tier Application

22 MVC – not again …

23 How the two brothers are different?

24 How the JSF Specification Fits In

25 errr... What’s a component? the JSF spec defines a standard set of components and relationships the View layer (e.g. JSP) and the Java code on the server use these components to interact and pass data JSF tree is the current set of components in a Java object graph Struts, Webwork, SpringMVC use actions, not components

26 typical JSF component tree View Form input command combo input

27 Enough of bla bla..some real action please Setup tools like Eclipse 3.5, Maven, 2.x, Tomcat/JBoss. Download the jsf jars. Additionally can use JBoss Tools.


Download ppt "Saif Kamaal Java Server Faces (JSF) Next Generation User Interface."

Similar presentations


Ads by Google