SlideShare una empresa de Scribd logo
1 de 29
Descargar para leer sin conexión
<Insert Picture Here>
True Abstraction
JSF 2.0 Composite Components
Ed Burns <http://ridingthecrest.com>
JSF Technical Lead
Oracle America, Inc.
2
Presentation GoalsPresentation Goals
• ShareShare the vision forthe vision for
composite componentscomposite components
• ExposeExpose you to everythingyou to everything
you need to know toyou need to know to
master compositemaster composite
componentscomponents
• DemonstrateDemonstrate the creationthe creation
of a non-trivial compositeof a non-trivial composite
componentcomponent
3
Agenda: All About Composite Components
• Beginning
– JSF 1.0 Vision and Reality
– JSF 2.0 Vision
– DEMO: A taste of the future
• Middle
– Fundamentals
– Practice
– Small stuff (resource bundles, EL in resources, “this”)
• End
– How to Think About Composite Components
4
Speaker Qualifications: Ed Burns
– Consulting Staff Member at Oracle America, Inc.
– Since inception, co-leader of the team that develops the JavaServer™
Faces (JSF) Specification
– Co-author of the McGraw-Hill book, JavaServer Faces, The Complete
Reference and upcoming JSF2: The Complete Reference
– Author of the McGraw-Hill book: Secrets of Rock Star Programmers:
Riding the IT Crest
– Prior to JSF Ed worked on the Sun Java Plug-in, Mozilla Open JavaVM
Interface, NCSA Mosaic
5
Beginning
6
JSF 1.x Vision for Components
Create a market for re-usable JSF
components, allowing developers to
easily create UI's for web applications by
combining off-the-shelf components from
multiple vendors using nice GUI tools.
UserUser
ComponentsComponents
OracleOracle
ComponentsComponents
SunSun
ComponentsComponents
7
JavaOne 2001 Technical Keynote
8
JSF 1.X Component Reality
• Good
– Very active and healthy component market
– Very good IDE support
• Bad
– Components not easy enough to build
– Component vendors had to invent stuff because the spec didn't
solve
• Ajax
• Resource Loading
• Library Ordering Precedence
9
JSF 2.0 Vision for Compnents
• This...
10
Make components easy to develop
• Becomes this...
11
Make components easy to develop
• Or maybe this...
… if you want to get fancy
• “Pay as you go” complexity
12
JSF 2.0 Component Vision
• multi-select components on a JSF
page
• press a “componentize” button
• you get a wizard that lets you choose
how to expose the content of this
component to the page author
• the component appears in a palette.
13
Demo: Simple Login Panel
14
Middle
15
Composite Component Fundamentals
1.Resource Libraries
2.Conventions
– XML Namespace
• Default namespace prefix + resource library name
– Component name
• XHTML filename in resource library
3.<cc:interface> <cc:implementation>
4.Top level component creation
5.Attached Objects
6.#{cc} implicit object
16
Fundamentals: Resource Libraries
• Completes the story for authoring
web components
– markup+css+script+images
– JSF 1.2 only had 25% of that story!
– All component artifacts bundled
together
• Allows the JSF lifecycle to serve
up static content
• Fully localized, versioned
• Dynamic
1. Web app root
2. Classpath
17
Fundamentals: Conventions
• Naming Convention
• Placement
Convention
18
Demo: Conventions
Ask the audience for names, show error messages, as cc is created in the demo
19
Fundamentals: <cc:interface> <cc:implementation>
• <cc:interface>
– Declares everything in the page author needs to know to use
this component. This is more formally known as the usage
contract.
• <cc:implementation>
– Defines the implementation of the contract declared in the
<cc:interface> section
• <cc:interface> can be empty (will be optional in
JSF2.next)
20
Fundamentals: Top Level Component
21
Fundamentals: Top Level Component
Rules for creating the Top-Level Component
1.See if the composite component declares a
componentType attribute on <cc:interface>
2.Look for a script based component with a file name that is the
same name (case sensitive) as the .xhtml file name
3.Look for a java class called <resourceLibName>.<fileName>
4.Create a component of component type
javax.faces.NamingContainer
22
Fundamentals: Attached Objects
23
Demo: Attached Objects
24
Fundamentals: #{cc} implicit object
25
Composite Components: Practice
26
Composite Components: Small stuff
• Resource Bundles in composite component library
• EL in resources
• Nested composite component
27
How do we enable this vision?
• Reduce the number of artifacts required
• Provide a way to bundle associated resources with the component
• Do it all dynamically, while the app is deployed
• Allow the composite component to be a real component
– attached objects
– children components
– facets
– ajax capable
• The “old way” still works.
28
the past, present, and future of the computer human
interface for network aware applications.
JSF 1.x
JSF 2.0
End
29
How to think about
Composite Components
• Building components should not be
scary or hard
• Make everything private and expose
only what the page author needs to
see
• Just do it!

Más contenido relacionado

La actualidad más candente

The Magic Revealed: Four Real-World Examples of Using the Client Object Model...
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...The Magic Revealed: Four Real-World Examples of Using the Client Object Model...
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...
SPTechCon
 

La actualidad más candente (20)

Java Server Pages
Java Server PagesJava Server Pages
Java Server Pages
 
Component Framework Primer for JSF Users
Component Framework Primer for JSF UsersComponent Framework Primer for JSF Users
Component Framework Primer for JSF Users
 
Laravel introduction
Laravel introductionLaravel introduction
Laravel introduction
 
JSF 2 and beyond: Keeping progress coming
JSF 2 and beyond: Keeping progress comingJSF 2 and beyond: Keeping progress coming
JSF 2 and beyond: Keeping progress coming
 
Intro JavaScript
Intro JavaScriptIntro JavaScript
Intro JavaScript
 
Jsp element
Jsp elementJsp element
Jsp element
 
Introduction to Alfresco Surf Platform
Introduction to Alfresco Surf PlatformIntroduction to Alfresco Surf Platform
Introduction to Alfresco Surf Platform
 
Laravel Introduction
Laravel IntroductionLaravel Introduction
Laravel Introduction
 
Zend Framework Quick Start Walkthrough
Zend Framework Quick Start WalkthroughZend Framework Quick Start Walkthrough
Zend Framework Quick Start Walkthrough
 
Laravel overview
Laravel overviewLaravel overview
Laravel overview
 
Introduction To Code Igniter
Introduction To Code IgniterIntroduction To Code Igniter
Introduction To Code Igniter
 
ColdFusion Fw1 (FrameWork1) introduction
ColdFusion Fw1 (FrameWork1) introductionColdFusion Fw1 (FrameWork1) introduction
ColdFusion Fw1 (FrameWork1) introduction
 
Laravel - The PHP Framework for Web Artisans
Laravel - The PHP Framework for Web ArtisansLaravel - The PHP Framework for Web Artisans
Laravel - The PHP Framework for Web Artisans
 
Jsp (java server page)
Jsp (java server page)Jsp (java server page)
Jsp (java server page)
 
Asp 1-mvc introduction
Asp 1-mvc introductionAsp 1-mvc introduction
Asp 1-mvc introduction
 
Jsp
JspJsp
Jsp
 
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...The Magic Revealed: Four Real-World Examples of Using the Client Object Model...
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...
 
Sightly - AEM6 UI Development using JS and JAVA
Sightly - AEM6 UI Development using JS and JAVASightly - AEM6 UI Development using JS and JAVA
Sightly - AEM6 UI Development using JS and JAVA
 
Custom module and theme development in Drupal7
Custom module and theme development in Drupal7Custom module and theme development in Drupal7
Custom module and theme development in Drupal7
 
Laravel ppt
Laravel pptLaravel ppt
Laravel ppt
 

Destacado (9)

Tech tuesday april_2010__revised
Tech tuesday april_2010__revisedTech tuesday april_2010__revised
Tech tuesday april_2010__revised
 
Organizing the Internet
Organizing the InternetOrganizing the Internet
Organizing the Internet
 
Menneskets værktøj (opgave 1)
Menneskets værktøj (opgave 1)Menneskets værktøj (opgave 1)
Menneskets værktøj (opgave 1)
 
Kommunikation/IT
Kommunikation/ITKommunikation/IT
Kommunikation/IT
 
What Makes U Tick08
What Makes U Tick08What Makes U Tick08
What Makes U Tick08
 
Facebook Pages Tech Tuesday November 2010
Facebook Pages Tech Tuesday November 2010Facebook Pages Tech Tuesday November 2010
Facebook Pages Tech Tuesday November 2010
 
Social Networking And Social Media June409
Social Networking And Social Media June409Social Networking And Social Media June409
Social Networking And Social Media June409
 
Peddling Progress - 1999 UWEX Cooperative Extension Conference Keynote
Peddling Progress - 1999 UWEX Cooperative Extension Conference KeynotePeddling Progress - 1999 UWEX Cooperative Extension Conference Keynote
Peddling Progress - 1999 UWEX Cooperative Extension Conference Keynote
 
Reaching new audiences ag conference jan2011
Reaching new audiences ag conference jan2011Reaching new audiences ag conference jan2011
Reaching new audiences ag conference jan2011
 

Similar a jsf2-composite-components

UKLUG 2012 - XPages, Beyond the basics
UKLUG 2012 - XPages, Beyond the basicsUKLUG 2012 - XPages, Beyond the basics
UKLUG 2012 - XPages, Beyond the basics
Ulrich Krause
 
Adobe Flex - Developing Rich Internet Application Workshop Day 2
Adobe Flex - Developing Rich Internet Application Workshop Day 2Adobe Flex - Developing Rich Internet Application Workshop Day 2
Adobe Flex - Developing Rich Internet Application Workshop Day 2
Shyamala Prayaga
 
J boss ide-tutorial
J boss ide-tutorialJ boss ide-tutorial
J boss ide-tutorial
UTN
 

Similar a jsf2-composite-components (20)

RichFaces CDK: Rapid JSF Component Development
RichFaces CDK: Rapid JSF Component DevelopmentRichFaces CDK: Rapid JSF Component Development
RichFaces CDK: Rapid JSF Component Development
 
JSF2 Composite Components - Ian Hlavats
JSF2 Composite Components - Ian HlavatsJSF2 Composite Components - Ian Hlavats
JSF2 Composite Components - Ian Hlavats
 
Getting Started with React, When You’re an Angular Developer
Getting Started with React, When You’re an Angular DeveloperGetting Started with React, When You’re an Angular Developer
Getting Started with React, When You’re an Angular Developer
 
[DanNotes] XPages - Beyound the Basics
[DanNotes] XPages - Beyound the Basics[DanNotes] XPages - Beyound the Basics
[DanNotes] XPages - Beyound the Basics
 
Web Development with Delphi and React - ITDevCon 2016
Web Development with Delphi and React - ITDevCon 2016Web Development with Delphi and React - ITDevCon 2016
Web Development with Delphi and React - ITDevCon 2016
 
XPages -Beyond the Basics
XPages -Beyond the BasicsXPages -Beyond the Basics
XPages -Beyond the Basics
 
UKLUG 2012 - XPages, Beyond the basics
UKLUG 2012 - XPages, Beyond the basicsUKLUG 2012 - XPages, Beyond the basics
UKLUG 2012 - XPages, Beyond the basics
 
Adobe Flex - Developing Rich Internet Application Workshop Day 2
Adobe Flex - Developing Rich Internet Application Workshop Day 2Adobe Flex - Developing Rich Internet Application Workshop Day 2
Adobe Flex - Developing Rich Internet Application Workshop Day 2
 
Reactjs
ReactjsReactjs
Reactjs
 
Fame
FameFame
Fame
 
Professionalizing the Front-end
Professionalizing the Front-endProfessionalizing the Front-end
Professionalizing the Front-end
 
Lightning web components
Lightning web components Lightning web components
Lightning web components
 
Introduction to React native
Introduction to React nativeIntroduction to React native
Introduction to React native
 
Spring framework Introduction
Spring framework  IntroductionSpring framework  Introduction
Spring framework Introduction
 
Custom JSF components
Custom JSF componentsCustom JSF components
Custom JSF components
 
Oracle 12c Launch Event 02 ADF 12c and Maven in Jdeveloper / By Aino Andriessen
Oracle 12c Launch Event 02 ADF 12c and Maven in Jdeveloper / By Aino Andriessen Oracle 12c Launch Event 02 ADF 12c and Maven in Jdeveloper / By Aino Andriessen
Oracle 12c Launch Event 02 ADF 12c and Maven in Jdeveloper / By Aino Andriessen
 
What are the components in React?
What are the components in React?What are the components in React?
What are the components in React?
 
Extension Library - Viagra for XPages
Extension Library - Viagra for XPagesExtension Library - Viagra for XPages
Extension Library - Viagra for XPages
 
J boss ide-tutorial
J boss ide-tutorialJ boss ide-tutorial
J boss ide-tutorial
 
Oracle JavaScript Extension Toolkit Web Components Bring Agility to App Devel...
Oracle JavaScript Extension Toolkit Web Components Bring Agility to App Devel...Oracle JavaScript Extension Toolkit Web Components Bring Agility to App Devel...
Oracle JavaScript Extension Toolkit Web Components Bring Agility to App Devel...
 

Más de Edward Burns

Más de Edward Burns (20)

Developer Career Masterplan
Developer Career MasterplanDeveloper Career Masterplan
Developer Career Masterplan
 
Jakarta EE 11 Status Update​
Jakarta EE 11 Status Update​Jakarta EE 11 Status Update​
Jakarta EE 11 Status Update​
 
Sponsored Session: Please touch that dial!
Sponsored Session: Please touch that dial!Sponsored Session: Please touch that dial!
Sponsored Session: Please touch that dial!
 
How modernizing enterprise applications gives you a competitive advantage
How modernizing enterprise applications gives you a competitive advantageHow modernizing enterprise applications gives you a competitive advantage
How modernizing enterprise applications gives you a competitive advantage
 
Wie Azure Jakarta EE Nutzt
Wie Azure Jakarta EE NutztWie Azure Jakarta EE Nutzt
Wie Azure Jakarta EE Nutzt
 
Practical lessons from customers performing digital transformation with Azure
Practical lessons from customers performing digital transformation with AzurePractical lessons from customers performing digital transformation with Azure
Practical lessons from customers performing digital transformation with Azure
 
wls-azure-devnexus-2022.pdf
wls-azure-devnexus-2022.pdfwls-azure-devnexus-2022.pdf
wls-azure-devnexus-2022.pdf
 
Jakarta EE und Microprofile sind bei Azure zu Hause
Jakarta EE und Microprofile sind bei Azure zu HauseJakarta EE und Microprofile sind bei Azure zu Hause
Jakarta EE und Microprofile sind bei Azure zu Hause
 
Java on Your Terms with Azure
Java on Your Terms with AzureJava on Your Terms with Azure
Java on Your Terms with Azure
 
Wars I’ve Seen From Java EE to Spring and more, Azure has you covered
Wars I’ve SeenFrom Java EE to Spring and more, Azure has you coveredWars I’ve SeenFrom Java EE to Spring and more, Azure has you covered
Wars I’ve Seen From Java EE to Spring and more, Azure has you covered
 
HTTP/2 Comes to Java: Servlet 4.0 and what it means for the Java/Jakarta EE e...
HTTP/2 Comes to Java: Servlet 4.0 and what it means for the Java/Jakarta EE e...HTTP/2 Comes to Java: Servlet 4.0 and what it means for the Java/Jakarta EE e...
HTTP/2 Comes to Java: Servlet 4.0 and what it means for the Java/Jakarta EE e...
 
Programming Language Platform Growth: Table Stakes or Deal Makes?
Programming Language Platform Growth: Table Stakes or Deal Makes?Programming Language Platform Growth: Table Stakes or Deal Makes?
Programming Language Platform Growth: Table Stakes or Deal Makes?
 
Programming Language Platform Growth: Table Stakes or Deal Makes?
Programming Language Platform Growth: Table Stakes or Deal Makes?Programming Language Platform Growth: Table Stakes or Deal Makes?
Programming Language Platform Growth: Table Stakes or Deal Makes?
 
Building a Serverless State Service for the Cloud
Building a Serverless State Service for the CloudBuilding a Serverless State Service for the Cloud
Building a Serverless State Service for the Cloud
 
Servlet 4.0 at GeekOut 2015
Servlet 4.0 at GeekOut 2015Servlet 4.0 at GeekOut 2015
Servlet 4.0 at GeekOut 2015
 
Burns jsf-confess-2015
Burns jsf-confess-2015Burns jsf-confess-2015
Burns jsf-confess-2015
 
JSF 2.2 Input Output JavaLand 2015
JSF 2.2 Input Output JavaLand 2015JSF 2.2 Input Output JavaLand 2015
JSF 2.2 Input Output JavaLand 2015
 
Java EE 7 from an HTML5 Perspective, JavaLand 2015
Java EE 7 from an HTML5 Perspective, JavaLand 2015Java EE 7 from an HTML5 Perspective, JavaLand 2015
Java EE 7 from an HTML5 Perspective, JavaLand 2015
 
HTTP/2 comes to Java. What Servlet 4.0 means to you. DevNexus 2015
HTTP/2 comes to Java.  What Servlet 4.0 means to you. DevNexus 2015HTTP/2 comes to Java.  What Servlet 4.0 means to you. DevNexus 2015
HTTP/2 comes to Java. What Servlet 4.0 means to you. DevNexus 2015
 
JSF 2.3 Adopt-a-JSR 10 Minute Infodeck
JSF 2.3 Adopt-a-JSR 10 Minute InfodeckJSF 2.3 Adopt-a-JSR 10 Minute Infodeck
JSF 2.3 Adopt-a-JSR 10 Minute Infodeck
 

Último

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 

jsf2-composite-components

  • 1. <Insert Picture Here> True Abstraction JSF 2.0 Composite Components Ed Burns <http://ridingthecrest.com> JSF Technical Lead Oracle America, Inc.
  • 2. 2 Presentation GoalsPresentation Goals • ShareShare the vision forthe vision for composite componentscomposite components • ExposeExpose you to everythingyou to everything you need to know toyou need to know to master compositemaster composite componentscomponents • DemonstrateDemonstrate the creationthe creation of a non-trivial compositeof a non-trivial composite componentcomponent
  • 3. 3 Agenda: All About Composite Components • Beginning – JSF 1.0 Vision and Reality – JSF 2.0 Vision – DEMO: A taste of the future • Middle – Fundamentals – Practice – Small stuff (resource bundles, EL in resources, “this”) • End – How to Think About Composite Components
  • 4. 4 Speaker Qualifications: Ed Burns – Consulting Staff Member at Oracle America, Inc. – Since inception, co-leader of the team that develops the JavaServer™ Faces (JSF) Specification – Co-author of the McGraw-Hill book, JavaServer Faces, The Complete Reference and upcoming JSF2: The Complete Reference – Author of the McGraw-Hill book: Secrets of Rock Star Programmers: Riding the IT Crest – Prior to JSF Ed worked on the Sun Java Plug-in, Mozilla Open JavaVM Interface, NCSA Mosaic
  • 6. 6 JSF 1.x Vision for Components Create a market for re-usable JSF components, allowing developers to easily create UI's for web applications by combining off-the-shelf components from multiple vendors using nice GUI tools. UserUser ComponentsComponents OracleOracle ComponentsComponents SunSun ComponentsComponents
  • 8. 8 JSF 1.X Component Reality • Good – Very active and healthy component market – Very good IDE support • Bad – Components not easy enough to build – Component vendors had to invent stuff because the spec didn't solve • Ajax • Resource Loading • Library Ordering Precedence
  • 9. 9 JSF 2.0 Vision for Compnents • This...
  • 10. 10 Make components easy to develop • Becomes this...
  • 11. 11 Make components easy to develop • Or maybe this... … if you want to get fancy • “Pay as you go” complexity
  • 12. 12 JSF 2.0 Component Vision • multi-select components on a JSF page • press a “componentize” button • you get a wizard that lets you choose how to expose the content of this component to the page author • the component appears in a palette.
  • 15. 15 Composite Component Fundamentals 1.Resource Libraries 2.Conventions – XML Namespace • Default namespace prefix + resource library name – Component name • XHTML filename in resource library 3.<cc:interface> <cc:implementation> 4.Top level component creation 5.Attached Objects 6.#{cc} implicit object
  • 16. 16 Fundamentals: Resource Libraries • Completes the story for authoring web components – markup+css+script+images – JSF 1.2 only had 25% of that story! – All component artifacts bundled together • Allows the JSF lifecycle to serve up static content • Fully localized, versioned • Dynamic 1. Web app root 2. Classpath
  • 17. 17 Fundamentals: Conventions • Naming Convention • Placement Convention
  • 18. 18 Demo: Conventions Ask the audience for names, show error messages, as cc is created in the demo
  • 19. 19 Fundamentals: <cc:interface> <cc:implementation> • <cc:interface> – Declares everything in the page author needs to know to use this component. This is more formally known as the usage contract. • <cc:implementation> – Defines the implementation of the contract declared in the <cc:interface> section • <cc:interface> can be empty (will be optional in JSF2.next)
  • 21. 21 Fundamentals: Top Level Component Rules for creating the Top-Level Component 1.See if the composite component declares a componentType attribute on <cc:interface> 2.Look for a script based component with a file name that is the same name (case sensitive) as the .xhtml file name 3.Look for a java class called <resourceLibName>.<fileName> 4.Create a component of component type javax.faces.NamingContainer
  • 26. 26 Composite Components: Small stuff • Resource Bundles in composite component library • EL in resources • Nested composite component
  • 27. 27 How do we enable this vision? • Reduce the number of artifacts required • Provide a way to bundle associated resources with the component • Do it all dynamically, while the app is deployed • Allow the composite component to be a real component – attached objects – children components – facets – ajax capable • The “old way” still works.
  • 28. 28 the past, present, and future of the computer human interface for network aware applications. JSF 1.x JSF 2.0 End
  • 29. 29 How to think about Composite Components • Building components should not be scary or hard • Make everything private and expose only what the page author needs to see • Just do it!