Download presentation
Presentation is loading. Please wait.
Published byMariah Matthews Modified over 9 years ago
2
First Programming Steps in Oracle ADF: Beyond Drag and Drop Grant Ronald Director of Product Management Mobility and Development Tools October, 2014 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
3
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.
4
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Program Agenda Why write code in Oracle ADF? Mapping declarative objects to classes First programming steps in ADF Business Components First programming steps in ADF Faces (time permitting) 1 2 3 4
5
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Program Agenda Why write code in Oracle ADF? Mapping declarative objects to classes First programming steps in ADF Business Components First programming steps in ADF Faces (time permitting) 1 2 3 4
6
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Why Write Code in Oracle ADF? ADF does a lot of the hard work for you Sometimes your application needs a developer’s touch – It’s not suppose to be a codeless framework! – Business domain specific requirements Validation and processes – Augment default framework behaviour – Quirky user requirements – Framework limitations Image: http://www.templates.com/blog/wp-content/uploads/2009/03/personal-robot-06-by-franz-steiner.jpg
7
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | The Goal of this Presentation? What you might be hoping for... Imagehttp://tyrannyoftradition.files.wordpress.com/2014/02/93434191-einstein-tongue_custom-36fb0ce35776dc2d92eda90880022bf48a67e192-s6-c30.jpg?w=620&h=695
8
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | The Goal of this Presentation? What you can realistically expect... Image: http://www.naturallydapper.com/wp-content/uploads/2014/07/start-of-race1.jpg
9
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | When it Comes to Demo Time Move closer if you want... Image: imagerymajestic/ FreeDigitalPhotos.net
10
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Program Agenda Why write code in Oracle ADF? Mapping declarative objects to classes First programming steps in ADF Business Components First programming steps in ADF Faces (time permitting) 1 2 3 4
11
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | It’s Behind You Behind a simple concept, something else is doing the hard work Image: nenovbrothers/ FreeDigitalPhotos.net
12
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | It’s Behind You Behind a simple concept, something else is doing the hard work Image: nenovbrothers/ FreeDigitalPhotos.net
13
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | It’s Behind You Entity Object – Represents a single row of data View Object – Represents a query of rows Application Module – Unit of work/transaction Behind every ADF declarative component, is a Java class Image: : sattva/ FreeDigitalPhotos.net
14
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | It’s Behind You Entity Object – EntityImpl.java View Object – ViewObjectImpl.java Application Module – ApplicationModuleImpl Behind every ADF declarative component, is a Java class
15
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Program Agenda Why write code in Oracle ADF? Mapping declarative objects to classes First programming steps in ADF Business Components First programming steps in ADF Faces (time permitting) 1 2 3 4
16
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Who Does What? The ADF Business Components Class Structure? ViewObjectImpl RowSet/RowsetIterator ViewRowImpl/Row EntityDefImpl EntityImpl
17
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | “Generate custom classes for each specific framework object…judiciously” – Grant Ronald, Oracle Open World 2014! Confucius
18
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Who Does What? The ADF Business Components Class Structure? EmpVOImpl DeptViewRowImpl DepartmentsImpl EmployeesImpl EmpViewRowImpl DeptVOImpl
19
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Where Do You Write Your Code? Method validator on entity objects – Application validation Custom methods – Implement application specific methods Override framework methods – Override, extend, augment default framework functionality The most common coding in ADF Business Components Image: stockimages/ FreeDigitalPhotos.net
20
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Where Do You Write Code? Get attribute values Validation in an EntityImpl
21
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Where Do You Write Code? Common methods in EntityImpl
22
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | “CTRL Enter is your best friend” – Grant Ronald, Oracle Open World 2014! Confucius
23
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Where Do You Write Code? Query – Execute a query – Order by – Where – Set bind variable values View criteria Common functionality in a view object
24
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Where Do You Write Code? Common methods in ViewObjectImpl
25
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | “CTRL Space is also your best friend” – Grant Ronald, Oracle Open World 2014! Confucius
26
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Where Do You Write Code? Pretty much any framework class Typical examples in EntityImpl – doDML – remove – create Override framework methods
27
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Common Patterns Image: Serge Bertasius Photography / FreeDigitalPhotos.net In ADF Business Components
28
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | “Do as I say, not as I do” – Grant Ronald, Oracle Open World 2014! Confucius
29
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Change A Where Clause and Execute Query Image: Serge Bertasius Photography / FreeDigitalPhotos.net ViewObjectImpl example
30
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Set Bind Variable and Execute Query Image: Serge Bertasius Photography / FreeDigitalPhotos.net ViewObjectImpl example
31
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Set Bind Variable And Apply View Criteria ViewObjectImpl example
32
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Set Bind Variable And Apply View Criteria ViewObjectImpl example
33
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Change The Current Row ViewObjectImpl example
34
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | “Java Doc is also your best friend – you need lots of best friends!” – Grant Ronald, Oracle Open World 2014! Confucius
35
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | ViewObjectImpl Examples View object is all about the query Common things I can do in a ViewObjectImpl – Set where clause – Set bind variables – Manage view criteria – Execute a query It also managed the rowset returned What have I just learned Image: stockimages / FreeDigitalPhotos.net
36
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | ADF Business Components Examples Working with view rows
37
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | ADF Business Components Examples Working with RowSet
38
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | ADF Business Components Examples Your own custom view row method Access “detail” rows Working with Row
39
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Iterate Through Detail Rows DepartmentsViewRowImpl
40
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | ViewObjectImpl and ViewRowImpl Examples A view object implements a “default” rowset Common things I can do with rows – Find a row based on a key – Traverse from “master” to “detail” – Traverse rows – Set row currency – Access row level attributes What have I just learned Image: stockimages / FreeDigitalPhotos.net
41
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Program Agenda Why write code in Oracle ADF? Mapping declarative objects to classes First programming steps in ADF Business Components First programming steps in ADF Faces (time permitting) 1 2 3 4
42
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Accessing Bindings From the UI The classes behind the building blocks Binding Data Control RatingDC CustomerDC OrdersDC OrdersDC ListBinding AttributeBinding HierarchyBinding ControlBinding Business Service CustomerVO OrdersVO RatingsVO
43
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Accessing Bindings From the UI The classes behind the building blocks Data Control BindingContainer DCDataControl JUCtrlListBinding AttributeBinding JUCtrlHierBinding OperationBinding Business Service CustomerVO OrdersVO RatingsVO BindingContext
44
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Commonly Used Methods Binding Context
45
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Commonly Used Methods Binding Container
46
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Commonly Used Methods A worked example
47
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Commonly Used Methods A worked example
48
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Bindings Always work through the bindings – Left hand knows what the right hand is doing Binding container is your gateway to page bindings – That’s the thing you create when you drag and drop on a page What have I just learned Image: stockimages / FreeDigitalPhotos.net
49
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | “Never try and teach programmatic bindings right before the Appreciation Party!” – Grant Ronald, Oracle Open World 2014! Confucius
50
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Safe Harbor Statement The preceding 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.
51
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.