Fundamentals – PL/SQL

I was and will always be fascinated by Oracle PL/SQL. Its one of those sophisticated language that will “almost” always be used in every project – and theres a good reason why.

  • Industry Standard
  • DM* (Data Manipulation) – can be isolated, packaged and reused.
  • Wide array of intrinsic functions to manipulate data –  as well as objects.
  • Easier to learn  – as it has a very straight forward approach in its procedural nature.
  • Callable by universally by any platform available. – APIs are already available to call database objects.

I don’t want to bore you with details so here are some very useful guides for PL/SQL here. The site has industry standard conventions, case studies, best practices and technical information on tips how to write injection proof PL/SQL. A good read for those who wants to improve and well informed in the technology.

For me, I have a few SQL scripts I’ve been working on to practice, you can download them from here.

Introduction: Book Review – Developing Web Applications with Oracle ADF Essentials

I’ve been doing a lot of practical exercises for the past few weeks regarding  JSF, specifically using the Seam Framework. Yet what I’m more intrigue about is the Oracle’s own Implementation of JSF called Oracle ADF (application development framework).


Experience with it?

I had some hands on experience with it in the past. I was trained for Oracle WebCenter Portal (basically the Enterprise Portal Solution of Oracle) and it uses Oracle ADF extensively in its core.  I was tasked back then to spearhead the implementation of Oracle WebCenter – I created the initial framework, setup, tech archiecture as well as the environment for Oracle WebCenter development. Its such a shame though that it did not push through. Although I wasn’t able to use the technology, I did find it very amusing and interesting – I even tried to create a Portal app of my own and create tutorial slides, but of course it was never really close to being one of my course skill.

A lull came when a particular publishing company contacted me to review their Book regarding Oracle ADF essentials. It was one of my goals to review and publish books of my expertise and this is a great start for me to do that.

So with the topic itself, for the new few days, I’ll try to document everything I learn and found out so far when reviewing the book. Hopefully, it will turn out great. Hopefully, this will be the key to my publisher / book author career. 🙂

The Book itself!

The Books is titled: Developing Web Applications with Oracle ADF Essentials by PACKT publishing – Author is Sten E. Vesterli

11-10-2013 2-19-03 PM

I read the introductory part of the book and I would say that there’s a lot of motivation behind the creation of this book. The author is a self proclaimed ADF Enthusiast and consider it as his core skill in his career. It was reviewed by number of peers that are highly regarded in their respective field – Eugene Fedorenko – Senior Analyst, Amr Gawish – Senior Oracle Fusion Middleware Consultant and Dimitrios Stasinopoulos – a Certified ADF implementation specialist. From their title alone, you can see that the very reason of the books existence. It was reviewed by technical expert of the field and the technology itself. Much like any other technical books (at least the majority of which), it came with a support files (ebooks, discount offers, downloadable samples). These support files will entirely help any person who uses and wish to learn the technology.

The Chapters!

By looking at the table of contents and chapters – users who wishes to learn the technology will ultimately be interested from the get go. It tackles real world examples as well as beginners journal / entry to the technology. It uses Open source software such as MySQL, GlassFish and the most stable JDK as of this writing, Java 7.

  1. Chapter 1: Basics – Develop your first ADF Essential Application
  2. Chapter 2: Creating business services – using JDeveloper and ADF underlying technological components.
  3. Chapter 3: Creating Task flows – essential for creating process driven applications
  4. Chapter 4: Addition the business logic – Tackles the essentials of creating business logic using the pre-defined set of rules of governance to create such components.
  5. Chapter 5: Building Enterprise Applications – build the structure of your code, apply design patterns, use ADF controls to create an enterprise grade applications. This chapter tackles on the activities (preferred ones) on building Enterprise Applications.
  6. Chapter 6: Debugging ADF Applications – the means of debugging is a general activity for every developer. One must know how to debug, set breakpoints and modify the controls to create the ultimate, valued solution.
  7. Chapter 7: Security – Enterprise applications must be secured since it can be used to manage highly sensitive data. This chapter will focus on implementing security controls on your application.
  8. Chapter 8: Build and Deploy – Finally, build your application and deploy them to a live environment. This chapter will help you create a build and deploy scheme to successfully run the application on a live environment.

I’ll try to be informative as I progress with the review  and put some of my example up here!

Oracle ADF – End to End Simple Application Tutorial

I find this video very nice and easy to catch up with. Very detailed and straight to the hands-on exercise.

The demonstrator uses Oracle JDeveloper to develop a simple Enterprise solution that uses Oracle ADF Framework.

Key notes:

  1. JDeveloper supports both Declarative and Narrative development.
  2. Developers can create EJB / JPA Business components and expose it through Data Controls.
  3. Data Controls are created to expose functionalities to Oracle ADF.
  4. Once Data Controls are created, this can be used to create ADF based form components like Manager Forms and Graphs

Review: The tutorial is more of a declarative way of developing ADF applications. It first creates a Database Connection, then create an EJB Diagram to create Session Beans and JPA Entities. This beans will be the back bone (model) of our application for database transactions. Next, create Data Controls to expose EJBs for Oracle ADF. Then after exposing these, we can now use the ADF framework to create pages and combine very useful ADF components (accordion, data grids, graphs etc.)

This tutorial really showcased the power of Oracle ADF + the use of JDeveloper. Its completely a new way of developing Java EE applications. JDeveloper brings another level of development scheme as showed on the tutorial, its a very flexible IDE that support both declarative and narrative development method.  The addition of full support on Oracle ADF sums up the whole package as it allows developers to drag and drop exposed ADF data controls and create components for it (graphs, forms, etc.).

Oracle JDeveloper 11g – First Hand on EJB/JPA Development

I find EJB/JPA Development in Oracle JDeveloper too good to be true! 🙂 Seriously. I tried developing a new Java EE Application using JDeveloper:

The wizard created 2 components in the project. A ViewController package and a Model Package.

ViewController Package – Is where all JSF/JSP and Servlets go, basically the view and controller sources. Model – Business Components such as EJBs and JPA entities are placed in this package.

Lets try creating an end to end Person Registration! 🙂

1st Step: Design the Model.

Go to New  > Offline Database

Start by creating a dummy database – developers can create an offline database (oracle database emulator) that will run with your application.

Then lets create a table on that offline database we just created.

Click on OK. After creating the table, new database components will be created on the project setup.

What we did with the first step is just to create a database and a table to store our Person Registration.

2nd Step: Create Model Diagram (EJB/JPA Diagram) and Components

After creating the database and table, we now need to create the components that will interact with the database from our application.

Create EJB/JPA Diagram: Developers usually skip the part of creating a diagram first – I would say that this process is one of the most under-rated process for any developer regardless of the platform  (I sometimes wonder how one can develop without even doing some drawing to visualize the flow of their application logic).

After hitting “OK”, a blank diagramming canvass will be displayed. Note: This canvass I believe is one of the most powerful feature of Oracle JDeveloper! – Keep reading.

Next, drag the PERSON table on the canvass. This will create a new Entity Bean (JPA entity bean), create a new Persistence unit and a persistence XML for its definition.

Note: I move the generated entity class to a new package (this is one of the features I actually don’t like about all this automation stuff).

Create a simple Stateless Session Bean. Drag a new Session Bean from the EJB Component Palette on the right side to the canvass.

This will open up a wizard to create the new Session Bean.

Methods will be automatically generated. These generated methods will perform basic querying, insertion, delete and update.

Put the Session Bean on the beans package.

Remote and Local Interface (Both interface will be placed on the beansiface package).

Session Beans are now created. 🙂

We just created our Model Layer. We can now use the Session Beans to do Database Transaction from our Controller.

3rd Step: Develop the Page and ManagedBean

Open the faces-config.xml – We will create 2 JSP that will handle user input and a success page.

After creating creating the Page Flow, we now create the actual page. Right click on the diagram page component to create page.

Pages can be created from a template or a blank page. I will discuss Page template development in another post. 🙂

Create a ManagedBean – this is the controller class where in we put form fields and actual call to the business logic. From the faces-config.xml, right click on the canvas to create the managedbean. This will create a new ManageBean entry on the xml file.

After the ManagedBean is created, put the fields First Name and Last Name (Generate or create Accessors) in it. Put also the logic to insert the new Person data.

Create a Registration Form. Open the registerperson page to create the form and map the fields to its corresponding ManagedBean mapping.

Success Page:

4th Step: Test the Person Registration

Right Click on the Register Person Page.

Test the Person Registration:

As I’m trying this stuff, it took me a while to get a hang of getting my source running. The first thing I did was not to rely on automation scripts to really experience how to assemble each piece of components together. Yet as I go along some roadblocks and issues, I would really say that if I’ll be using this IDE for J2EE Development, I would rather build it using the automation tools available.

The Diagram tool is amazing, drag and drop your components and your off and running.

Offline database is cool. You don’t have to mind how much memory would it consume your terminal just to try a EJB/JPA, you can just use the offline database (which is basically just a file) and your good to go.

JSF Flow Diagram is great. I’ve use the faces-config diagram and its like mapping the flow of your pages. All drag and drop components are available, page and beans generate are also available.

One thing I didn’t like at all is the package management, it seems that if you have a convention of creating sub-packages, you’ll likely to be irritated by that fact that it can’t create sub-package for itself. You’ll have to create one sub-package after the other.

Overall, I’m impress how Oracle manage to put a lot of automation in the IDE. The Diagramming canvass is perfect for modelling (EJB and JPA generated), the offline database is too good to be true for development trials and the JSF Diagram canvass from faces-config and bean generators really did put the ease on developing view components.

Download the project here

Oracle JDeveloper 11g – First Hand

It was really interesting for me to check-out those Oracle Software Technologies available, besides all of which are free to download so why not try some of them. 🙂

Let me give it a shot this night then.

Oracle JDeveloper 11g is the standard IDE for Application Development from Oracle, and by that means that this IDE is simply the best when it comes to Oracle Software Development.

Oracle Technologies isn’t that bad, they are actually great. My first hand in using this IDE is simply to develop a simple MVC Application, EJB 3.0 Business Component for the Model and ADF/Servlet for View and Controller Components.

First, the IDE itself:

The IDE is amazing, I would say that it can now compete with Microsoft Visual Studio, although the slowness is still annoying  (Same as SQL Developer IDE). It sometimes lags and try to ask your permission to close the entire application because of an unknown error. (Please fix this Oracle).

Database Connection:

Connecting to a database is just a breeze of clicks in this IDE. Just double click in this explorer and create new; Make sure though that you have the necessary database driver.


Business Tier Components

ADF Business Components – oracle also develop a new business component called ADF business components, its somehow resembles EJB (Standard J2EE Business Components) but with more features for developer business component development, plus easier to bound with ADF Web Components.

or EJB Business Components – Standard J2EE Business Component.


ADF – JSF Components

Customize your pages using the design/source and preview panel with the palette of tools to choose from the ADF Framework.

My Cents.

Oracle JDeveloper 11g, clearly (for me) surpass what I expected from a Development Environment, its a perfect fit for those who wants to try out Oracle Technologies plus it comes with a lot of supporting third party tools plugins such as SCM, Database IDE, Integrated Application Server, Profiler, HTTP Analuzer, etc… For the hardcore Oracle Developer, this is a must have, you’ll definitely feel like home using this IDE. It isn’t a bad IDE for non-oracle J2EE development as well as it purely support J2EE Application Development, as long as you know your way around integrating J2EE frameworks, libraries and tools – its a fine choice.

Although the IDE is really a must have for Oracle Enterprise Developers, I wouldn’t recommend this one for Java “scripting” developers (scripting simple automation tools using Java). Your better off using Eclipse or JCreator since these IDE’s offers optimized project setup for simple Java Scripting Development. Though JDeveloper also has this capability, it would still load some third party tools and libaries at startup time, making it consumes more memory that it has to be.

For Java Developers using Eclipse – It will irritate you a bit since it won’t feel like Eclipse, it will be a challenging learning curve at first (certainly true for Hardcore Java Developers who really like to code from ground up) since there’s a lot of automation tools that you need to learn and get a hang.

For Java Swing/AWT Developers – This IDE is a must try. NetBeans is a bit annoying for me since it sometimes spoonfeed developers – there are code fragments that you can’t edit (Sorry NetBeans fans.. )

For Java Spring Developers – The current version has support for Spring 2.5 – if you want to integrate Spring with ADF (trust me, ADF is purely awesome).

Oracle BPM / Portal Developers – This IDE directly support this technologies – downloadable in its built-in update site.

Features that I really liked:

  • Integrated Weblogic Server (10.4)
  • Complete and Full Support on Oracle ADF  – Oracle propritary J2EE Application Framework
  • Easy Database Connection Integration
  • Offline Database – Cached Copy of the Database
  • Modelling Tools (UML) and Diagrams
  • Plugins for Oracle Technologies (WebCenter, BPM, IDM, UCM etc.)
  • Toplink / Hibernate and JPA Support
  • Update site
  • Business and Web Components Development
  • Swing /AWT Development
  • Struts, Spring and JSF Support
  • Display/Source and Preview
  • JSF Templating Support
  • Maven Build Support
  • Ant Build
  • Local and Remote Deployment
  • Support Integration of other Application Servers – Tomcat, Jboss and Websphere
Features I didn’t reallly liked (aside from the IDE being so slow):
  • A lot of new components where introduced
  • Some automation tools are mandatory – you sometimes missed some dependencies because of not using them.
  • It really felt that you’re developing an application the “Oracle Way” – not that portable way
  • Consumes a lot of  Memory (Oracle Weblogic and JDeveloper IDE).
  • Its not Ecplise 🙂
Recommended Reading / Watching: