Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Oracle JDeveloper 11gR2 Cookbook

You're reading from   Oracle JDeveloper 11gR2 Cookbook Using JDeveloper to build ADF applications is a lot more straightforward when you learn through practical recipes. This book has over 85 of them to take you beyond the basics and raise your knowledge to a new level.

Arrow left icon
Product type Paperback
Published in Jan 2012
Publisher Packt
ISBN-13 9781849684767
Length 406 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Nick Haralabidis Nick Haralabidis
Author Profile Icon Nick Haralabidis
Nick Haralabidis
Arrow right icon
View More author details
Toc

Table of Contents (19) Chapters Close

Oracle JDeveloper 11gR2 Cookbook
Credits
Foreword
About the Author
About the Reviewers
www.PacktPub.com
1. Preface
1. Prerequisites to Success: ADF Project Setup and Foundations FREE CHAPTER 2. Dealing with Basics: Entity Objects 3. A Different Point of View: View Object Techniques 4. Important Contributors: List of Values, Bind Variables, View Criteria 5. Putting them all together: Application Modules 6. Go with the Flow: Task Flows 7. Face Value: ADF Faces, JSF Pages, and User Interface Components 8. Backing not Baking: Bean Recipes 9. Handling Security, Session Timeouts, Exceptions, and Errors 10. Deploying ADF Applications 11. Refactoring, Debugging, Profiling, and Testing 12. Optimizing, Fine-tuning, and Monitoring

Setting up BC base classes


One of the first things to consider when developing large-scale enterprise applications with ADF-BC is to allow for the ability to extend the framework's base classes early on in the development process. It is imperative that you do this before creating any of your business objects, even though you have no practical use of the extended framework classes at that moment. This will guarantee that all of your business objects are correctly derived from your framework classes. In this recipe, you will expand on the previous recipe and add business components framework extension classes to the SharedComponents workspace.

Getting ready

You will be adding the business components framework extension classes to the SharedComponents workspace. See the previous recipe for information on how to create one.

How to do it…

  1. 1. To create framework extension classes for the commonly used business components, start with the creation of an extension class for the entity objects. Open the SharedComponents workspace in JDeveloper and right-click on the SharedBC business components project.

  2. 2. From the context menu, select New… to bring up the New Gallery dialog. Select Class from the Java category (under the General category) and click OK.

  3. 3. On the Create Java Class dialog that is displayed, enter the name of the custom entity object class, the package where it will be created, and for Extends enter the base framework class, which in this case is oracle.jbo.server.EntityImpl.

  4. 4. Now, repeat the same steps to create framework extension classes for the following components:

    Business Component

    Framework Class Extended

    Entity Definition

    oracle.jbo.server.EntityDefImpl

    View Object

    oracle.jbo.server.ViewObjectImpl

    View Row

    oracle.jbo.server.ViewRowImpl

    Application Module

    oracle.jbo.server.ApplicationModuleImpl

    Database Transaction Factory

    oracle.jbo.server.DatabaseTransactionFactory

    Database Transaction

    oracle.jbo.server.DBTransactionImpl2

  5. 5. Once you are done, your project should look similar to the following:

  6. 6. The next step is to configure JDeveloper so that all new business components that you create from this point forward will be inherited from the framework extension classes you've just defined. Open the Preferences dialog from the Tools menu, expand the ADF Business Components node, and select Base Classes.

  7. 7. Then enter the framework extension classes that you created previously, each one in its corresponding category.

How it works…

Defining and globally configuring business components framework extension classes via the ADF Business Components Base Classes settings on the Preferences dialog causes all subsequent business components for all projects to be inherited from these classes. This is true for both XML-only components and for components with custom Java implementation classes. For XML-only components observe that the ComponentClass attribute in the object's XML definition file points to your framework extension class.

There's more…

You can configure your business components framework extension classes at two additional levels: the project level and the individual component level.

  • Configuration at the project level is done via the Project Properties Base Classes selection under the ADF Business Components node. These configuration changes will affect only the components created for the specific project.

  • Configuration at the component level is done via the component's Java Options dialog, in the component's definition Java page, by clicking on the Classes Extend… button and overriding the default settings. The changes will only affect the specific component.

Note

Do not attempt to directly change or remove the extends Java keyword in your component's implementation class. This would only be half the change, because the component's XML definition will still point to the original class. Instead, use the Classes Extend… button on the component's Java Options dialog.

Finally, note that the default package structure for all business components can also be specified in the ADF Business Components | Packages page of the Preferences dialog.

See also

  • Creating and using generic extension interfaces, Chapter 5,Putting them all together:Application Modules.

  • Breaking up the application in multiple workspaces, in this chapter

You have been reading a chapter from
Oracle JDeveloper 11gR2 Cookbook
Published in: Jan 2012
Publisher: Packt
ISBN-13: 9781849684767
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime