![Page 1: True Abstraction - Oracle › glassfish › wiki-archive › attachments › ... · True Abstraction JavaServer™ Faces 2.0 Composite Components ... Secrets of Rock Star Programmers:](https://reader035.vdocuments.mx/reader035/viewer/2022070818/5f16beebb8c3fb06592f0a2e/html5/thumbnails/1.jpg)
True AbstractionJavaServer™ Faces 2.0 Composite Components
Ed Burns <http://ridingthecrest.com/>
![Page 2: True Abstraction - Oracle › glassfish › wiki-archive › attachments › ... · True Abstraction JavaServer™ Faces 2.0 Composite Components ... Secrets of Rock Star Programmers:](https://reader035.vdocuments.mx/reader035/viewer/2022070818/5f16beebb8c3fb06592f0a2e/html5/thumbnails/2.jpg)
Presentation GoalsPresentation Goals
DemonstrateDemonstrate the usage the usage of composite componentsof composite componentsShareShare the vision for the vision for composite componentscomposite componentsShowShow how to build a how to build a composite componentcomposite component
![Page 3: True Abstraction - Oracle › glassfish › wiki-archive › attachments › ... · True Abstraction JavaServer™ Faces 2.0 Composite Components ... Secrets of Rock Star Programmers:](https://reader035.vdocuments.mx/reader035/viewer/2022070818/5f16beebb8c3fb06592f0a2e/html5/thumbnails/3.jpg)
3Agenda: All About Composite ComponentsBeginning
> JSF 1.0 Vision and Reality
> JSF 2.0 Vision
> DEMO: A taste of the futureMiddle
> DEMO: Building a simple composite Component
> Terminology
> Core ConceptsEnd
> How to Think About Composite Components
![Page 4: True Abstraction - Oracle › glassfish › wiki-archive › attachments › ... · True Abstraction JavaServer™ Faces 2.0 Composite Components ... Secrets of Rock Star Programmers:](https://reader035.vdocuments.mx/reader035/viewer/2022070818/5f16beebb8c3fb06592f0a2e/html5/thumbnails/4.jpg)
4
Speaker Qualifications: Ed Burns> Senior Staff Engineer at Sun Microsystems, 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
![Page 5: True Abstraction - Oracle › glassfish › wiki-archive › attachments › ... · True Abstraction JavaServer™ Faces 2.0 Composite Components ... Secrets of Rock Star Programmers:](https://reader035.vdocuments.mx/reader035/viewer/2022070818/5f16beebb8c3fb06592f0a2e/html5/thumbnails/5.jpg)
5Beginning
![Page 6: True Abstraction - Oracle › glassfish › wiki-archive › attachments › ... · True Abstraction JavaServer™ Faces 2.0 Composite Components ... Secrets of Rock Star Programmers:](https://reader035.vdocuments.mx/reader035/viewer/2022070818/5f16beebb8c3fb06592f0a2e/html5/thumbnails/6.jpg)
6JSF 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.
HTMLHTML
UserUserComponentsComponents
OracleOracleComponentsComponents
SunSunComponentsComponents
![Page 7: True Abstraction - Oracle › glassfish › wiki-archive › attachments › ... · True Abstraction JavaServer™ Faces 2.0 Composite Components ... Secrets of Rock Star Programmers:](https://reader035.vdocuments.mx/reader035/viewer/2022070818/5f16beebb8c3fb06592f0a2e/html5/thumbnails/7.jpg)
7JavaOne 2001 Technical Keynote
![Page 8: True Abstraction - Oracle › glassfish › wiki-archive › attachments › ... · True Abstraction JavaServer™ Faces 2.0 Composite Components ... Secrets of Rock Star Programmers:](https://reader035.vdocuments.mx/reader035/viewer/2022070818/5f16beebb8c3fb06592f0a2e/html5/thumbnails/8.jpg)
8
JSF 1.X Component Reality
Good
> Very active and healthy component market
> Very good IDE supportBad
> Components not easy enough to build
> Component vendors had to invent stuff because the spec didn't solve
– Ajax
– Resource Loading
– Library Ordering Precedence
![Page 9: True Abstraction - Oracle › glassfish › wiki-archive › attachments › ... · True Abstraction JavaServer™ Faces 2.0 Composite Components ... Secrets of Rock Star Programmers:](https://reader035.vdocuments.mx/reader035/viewer/2022070818/5f16beebb8c3fb06592f0a2e/html5/thumbnails/9.jpg)
9JSF 2.0 Vision for Compnents
This...
![Page 10: True Abstraction - Oracle › glassfish › wiki-archive › attachments › ... · True Abstraction JavaServer™ Faces 2.0 Composite Components ... Secrets of Rock Star Programmers:](https://reader035.vdocuments.mx/reader035/viewer/2022070818/5f16beebb8c3fb06592f0a2e/html5/thumbnails/10.jpg)
10
Make components easy to develop
Becomes this...
![Page 11: True Abstraction - Oracle › glassfish › wiki-archive › attachments › ... · True Abstraction JavaServer™ Faces 2.0 Composite Components ... Secrets of Rock Star Programmers:](https://reader035.vdocuments.mx/reader035/viewer/2022070818/5f16beebb8c3fb06592f0a2e/html5/thumbnails/11.jpg)
11
Make components easy to develop
Or maybe this...
… if you want to get fancy“Pay as you go” complexity
![Page 12: True Abstraction - Oracle › glassfish › wiki-archive › attachments › ... · True Abstraction JavaServer™ Faces 2.0 Composite Components ... Secrets of Rock Star Programmers:](https://reader035.vdocuments.mx/reader035/viewer/2022070818/5f16beebb8c3fb06592f0a2e/html5/thumbnails/12.jpg)
12
JSF 2.0 Component Visionmulti-select components on a JSF pagepress a “componentize” buttonyou get a wizard that lets you choose how to expose the content of this component to the page authorthe component appears in a palette.
![Page 13: True Abstraction - Oracle › glassfish › wiki-archive › attachments › ... · True Abstraction JavaServer™ Faces 2.0 Composite Components ... Secrets of Rock Star Programmers:](https://reader035.vdocuments.mx/reader035/viewer/2022070818/5f16beebb8c3fb06592f0a2e/html5/thumbnails/13.jpg)
13
Demo: Login Panel from Admin GUI
![Page 14: True Abstraction - Oracle › glassfish › wiki-archive › attachments › ... · True Abstraction JavaServer™ Faces 2.0 Composite Components ... Secrets of Rock Star Programmers:](https://reader035.vdocuments.mx/reader035/viewer/2022070818/5f16beebb8c3fb06592f0a2e/html5/thumbnails/14.jpg)
14How do we enable this vision?Reduce the number of artifacts requiredProvide a way to bundle associated resources with the componentDo it all dynamically, while the app is deployedAllow the composite component to be a real component
> attached objects
> children components
> facets
> ajax capableThe “old way” still works.
![Page 15: True Abstraction - Oracle › glassfish › wiki-archive › attachments › ... · True Abstraction JavaServer™ Faces 2.0 Composite Components ... Secrets of Rock Star Programmers:](https://reader035.vdocuments.mx/reader035/viewer/2022070818/5f16beebb8c3fb06592f0a2e/html5/thumbnails/15.jpg)
15
How do we solve the “multi-component-vendors in a single page” problem?
Look at what each vendor had to invent and standardize it
Source of difficulty Old Way Standard Way
Resource Loading PhaseListener, Filter, etc.
Built into the Lifecycle
Ajax ●Proprietary .js file for innerHTML updatingPropretary●XML Ajax Response Format
●jsf.ajax JavaScript Object with four functions●Standard XML Ajax Response Format
Library Loading Precedence
Rename Jar files for alphabetical sort order
<ordering>, <absolute-ordering> elements
![Page 16: True Abstraction - Oracle › glassfish › wiki-archive › attachments › ... · True Abstraction JavaServer™ Faces 2.0 Composite Components ... Secrets of Rock Star Programmers:](https://reader035.vdocuments.mx/reader035/viewer/2022070818/5f16beebb8c3fb06592f0a2e/html5/thumbnails/16.jpg)
16Middle
![Page 17: True Abstraction - Oracle › glassfish › wiki-archive › attachments › ... · True Abstraction JavaServer™ Faces 2.0 Composite Components ... Secrets of Rock Star Programmers:](https://reader035.vdocuments.mx/reader035/viewer/2022070818/5f16beebb8c3fb06592f0a2e/html5/thumbnails/17.jpg)
17Demo: Building your first composite component
![Page 18: True Abstraction - Oracle › glassfish › wiki-archive › attachments › ... · True Abstraction JavaServer™ Faces 2.0 Composite Components ... Secrets of Rock Star Programmers:](https://reader035.vdocuments.mx/reader035/viewer/2022070818/5f16beebb8c3fb06592f0a2e/html5/thumbnails/18.jpg)
18Coming to Terms with Composite ComponentsComposite Component
> A tree of UIComponent instances, rooted at a top level component that can be thought of and used as a single component in a view
Using Page
> The page in which a composite component is usedComposite Component Tag Instance
> The tag that places an instance of a composite component in the using page Defining Page
> The markup page, usually Facelets that contains the composite component declaration and definition
![Page 19: True Abstraction - Oracle › glassfish › wiki-archive › attachments › ... · True Abstraction JavaServer™ Faces 2.0 Composite Components ... Secrets of Rock Star Programmers:](https://reader035.vdocuments.mx/reader035/viewer/2022070818/5f16beebb8c3fb06592f0a2e/html5/thumbnails/19.jpg)
19Coming to Terms with Composite ComponentsTop Level Component
> The UIComponent instance implicitly created by the run-time to serve as the root for the composite component tree.
Inner Component
> Any UIComponent inside the defining page or any pages used by that defining page
![Page 20: True Abstraction - Oracle › glassfish › wiki-archive › attachments › ... · True Abstraction JavaServer™ Faces 2.0 Composite Components ... Secrets of Rock Star Programmers:](https://reader035.vdocuments.mx/reader035/viewer/2022070818/5f16beebb8c3fb06592f0a2e/html5/thumbnails/20.jpg)
20
Other Composite Component Concepts
Method Expressions DEMORuntime MetadataResourcesPer-component ResourceBundleCustom top level components, also from Script
![Page 21: True Abstraction - Oracle › glassfish › wiki-archive › attachments › ... · True Abstraction JavaServer™ Faces 2.0 Composite Components ... Secrets of Rock Star Programmers:](https://reader035.vdocuments.mx/reader035/viewer/2022070818/5f16beebb8c3fb06592f0a2e/html5/thumbnails/21.jpg)
21
the past, present, and future of the computer human interface for network aware applications.
JSF 1.x
JSF 2.0
End
![Page 22: True Abstraction - Oracle › glassfish › wiki-archive › attachments › ... · True Abstraction JavaServer™ Faces 2.0 Composite Components ... Secrets of Rock Star Programmers:](https://reader035.vdocuments.mx/reader035/viewer/2022070818/5f16beebb8c3fb06592f0a2e/html5/thumbnails/22.jpg)
22How to think about Composite Components
Building components should not be scary or hardMake everything private and expose only what the page author needs to seeJust do it!