250 likes | 263 Views
Learn about ADF, its business components and view objects, manipulating view object attributes, event-driven UI model, and more. Explore the advantages of ADF over the traditional Forms approach.
E N D
A developer’s peek inside JDeveloperADF Business Components &ADF Faces SAGE Computing ServicesCustomised Oracle Training Workshops and Consulting www.sagecomputing.com.au Penny Cookson – Managing DirectorChris Muir – Senior Consultant
What’s wrong with the Forms approach? What is ADF? ADF Business Components Entity Objects & View Objects Manipulating View Objects Attributes ADF Faces Page flow diagrammer Event driven UI model Learning resources Agenda
Java Cake What’s wrong with the Forms approach? JavaServer Faces Encryption Web Anything Web Services Canvas Mobile Computing Any J2EE Server SOA Block Ajax Standards Any JDBC Database Javascript Failover Database Swing BPEL Platform Independence Vendor Independence Rich Clients Email Services Scalability JavaServer Pages Oracle Just about anything exciting happening in computing FORMS Remand Centre
What is ADF? ADF What? • Application Development Framework … A comprehensive & complete MVC framework for developers to assist building J2EE applications … Forms provides you with a “black box” framework … ADF is a “white box” and provides ultimate flexibility and power … • ADF Business Components … ADF BC is one “persistent layer API” choice within ADF … used for connecting to the database, model data and store data in the Java mid-tier, and implement sophisticated business logic and security • ADF Faces … A feature rich set of web components based on an events model similar to Forms, designed to abstract away from the HTTP request-response fiasco and HTML over-detailed tag programming
ADF Business ComponentsEntity Objects & View Objects View Objects Entity Objects R/W User Interface R/W Database R/O DML Insert/Update/Delete Validation SQL Queries Security Code re-use
Manipulating View Objects Design Time View Only Objects and underlying SQL query can be switched into Expert Mode
Manipulating View Objects Runtime Manipulation Bind Variables Oracle Named Oracle Positional JDBC Positional Set Binds via Custom Code & exposing Model Services
EO/VO Transient Attributes aka Calculated Items Based on: Simple expressions Sub-Queries Function Calls
Attribute Default Values 2 Approaches Declarative: EO/VO Attributes Code: Create method The EntityImpl
Attribute Formatting 2 Approaches Declarative: EO/VO Attributes Control Hints Code: Create a RegExp validation Domain The DomainImpl
Data Validation - declarative 2 Approaches Declarative: EO Validators Can be both at entity level or Attribute level
Data Validation - code 2 Approaches Code: EO Validators Can be both at entity level or Attribute level The EntityImpl
DML Methods Yes! There are equivalents of Core Forms Transactional Triggers. The EntityImpl protected void doDML(int operation, TransactionEvent e) { if (operation == DML_INSERT) { /* write PRE-INSERT trigger-like code here */ super.doDML(operation, e); /* Don't call the super and do something else to write ON-INSERT trigger-like code */ /* write POST-INSERT trigger-like code here */ } else if (operation == DML_UPDATE) { /* write PRE-UPDATE trigger-like code here */ super.doDML(operation, e); /* Don't call the super and do something else to write ON-UPDATE trigger-like code here */ /* write POST-UPDATE trigger-like code here */ } else if (operation == DML_DELETE) { /* write PRE-DELETE trigger-like code here */ super.doDML(operation, e); /* Don't call the super and do something else to write ON-DELETE trigger-like code here */ /* write POST-DELETE trigger-like code here */ } }
Exposing Model Services Custom Code Exposing Custom Code – Model Services Eg. Set View Bind Variable based on User Input The AppModuleImpl
Is Database PL/SQL dead? PLSQL No it’s not, it’s just hiding! Invoking DB Stored Procedures and Functions One of many ways • Callable statement • new Dev Guide • JDev Help • JPublisher • JDev Help • Expose as web service
ADF FacesPage Navigation Page Navigation 1 - Create the Navigation Rule Piece of Cake Easy to Build Easy to Apply Easy to Change 2 - Use the Rule
Event Driven UI Model ADF BC Binding Object DeclarativeBinding Methods Declarative Handling Bound by EL Submittable Component << Event ------- Listener ------- Handler >> Backing Bean Method Handling [injected]ADF BC Binding Object Bound by EL Submittable Component DeclarativeBinding Methods
Event Driven UI Model… What’s the equivalent of the when-button-pressed trigger? It’s just a few clicks away – xxxButton_action 3 – ActionListener refers BackingBean method 2 – Create BackingBean and method 4 – BackingBean method ready for code 1 - Select Button and ActionListener
Event Driven UI Model… A Few more UI Listeners and Handlers new Dev Guide
UI Tidbits EL (JSF Expression Language) • JSTL & JSP EL vs JSF EL • Tricks Eg, re-usable label text codelike expressions enable/disable… PPR (Partial Page Rendering) • AJAX style The BACK Button • See Token Validation
Complex UI Components LOVs Shuttles Trees Screenshots courtesy of Oracle’s SRDemo
The Full Picture Forms <=> ADF BC/ADF Faces • Forms UI focused triggers PL/SQL modules Libraries Transactional triggers … • ADF BC / ADF Faces UI events + listeners Backing beans Application module services BC framework methods…
Our 1 week JDeveloper course for Forms Programmers! ;) ADF Developer’s Guide for 4GL/Forms Programmers ADF Developer’s Guide for Java Programmers SRDemo - like Toystore demo OTN JDeveloper website – no really! Has many very important and good learning resources. Metalink - don’t dismiss Metalink as just Support. You may find condensed solutions when compared to full blown Doco. OTN JDeveloper Forums – JDev team answer questions on hour by hour basis Blogs - don’t overlook blogs and read every day Visit the JDev blog aggregator: http://thepeninsulasedge.com/adfblog Don’t just stick to Oracle. JSF is a Sun & Java technology. There are plenty of other good sites out there beyond Oracle’s. Learning Resources
Thank YouFor Your Attention enquiries@sagecomputing.com.au SAGE Computing ServicesCustomised Oracle Training Workshops and Consulting www.sagecomputing.com.au