Wednesday, 3 February 2016

Introduction to JDeveloper

In this article, we'll be looking into an IDE to help the development of ADF Applications.

You may raise questions, why not using Eclipse/Netbeans/IntelliJ to develop ADF applications.

The simple answer is, if you want to develop an ADF Application, JDeveloper is the best suit for your needs.

Well, let's start with a simple definition of this IDE.

Oracle JDeveloper:  Oracle JDeveloper, also known as JDeveloper is a 100% Java based IDE to facilitate development of Java based applications.
In practical scenarios, it is best suited for Oracle Fusion Middleware applications like Oracle  ADF, Oracle SOA Suite etc.

Can we use Eclipse ?
Well, you can use it provided that, you have to deal with all the coding manually. Meaning, you will be dealing with different xml files. In this case, it is more error prone and if you lose a file or configuration, surely this will be a nightmare for you.

Well, there is a good news, Oracle provides an Eclipse Plugin known as OEPE. This plug in helps you develop ADF Applications in Eclipse as well. The key point is that, you will loose many of the advanced features that a full version of ADF uses. Its basically to support ADF Essentials (stripped down version of Oracle ADF).

Here is video from Oracle Product Manager demonstrating the process of using this plug in for development. Interested readers must watch this video end to end.


Oracle ADF Development in Eclipse


Well, for others (including me), we are simply be going through Oracle JDeveloper 11g version. You can download and install it from Oracle Website. I will refrain myself from detailing the details of IDE Installation. Because, I assume that, if you are trying to develop applications, you are indeed a Java developer. So the installation won't surprise you. Its fairly simple.

Still if you are stuck at any point, comments are always welcome.

With said that, here you go with the download link.

Apart from JDeveloper, we'll also be requiring a database for development. Because, using Oracle ADF we build data driven applications. I recommend using Oracle 11g XE database download for this purpose. Here is the download link.
Download the database, install it and unlock the HR Schema. Below you see the SQL code to unlock the HR Schema.
ALTER USER hr ACCOUNT UNLOCK;

If you are facing issues while doing this, check this link.
You may argue that, we do not need a database all the time, we simply can invoke web services for persistence. To your argument, I would like to remind you that, we are just going with a very basic application building approach where we'll be exploring all the features ADF provides to us and as we are here to explore things, we'll also get to know that, the underneath data service is quite irrelevant when we are talking about ADF. Because, once you get the concept, its really simple to change the underlying data service to change from database to web services.

Come back when your environment is ready.

So, you have installed JDeveloper or OEPE and we are now in a good shape to look at the features Oracle JDeveloper provides,

If we think of an application, what we usually think ?

  • What would be the design of the application ?
  • How the data structure should look like ?
  • What are technology we should use ?
  • Do we require any service consumption ?
  • How do we test our application ?
  • What about the security ?
  • How to deploy the application ?
Once you are through these, you think of implementation. At this point you may think,
  • Design is in place, what about implementing the database part.
  • I have got all the use cases, validations, business rules and the data layer. Let's start our development of the business service.
  • At this time you are relaxed because major business implementation is complete. Now you think of creating the UI layer.
  • UI is complete, now what about integrating the UI with the business services through controllers.
  • Well, how the navigation should look like. Where the user can start and where does it end. What about different event handling ?
  • When you are done with all these stuff, you work with deployment and testing.
So, that's basically a pretty scenario of any application development. Now let's see where JDeveloper helps us in this case. An IDE is good if it provides you with tooling support for faster development. Let's now look into JDeveloper features.
  • When you create an application, JDeveloper provides you with a status tracker of each step of development. This is great for planning and tracking.
  • JDeveloper comes with support for offline database modelling. You can create an offline replica of your database.
  • Not all the applications will use the same technology. In JDeveloper you can choose technologies in your projects based on your requirement.
  • If we need to consume a web service, JDeveloper comes with built-in support for web services.
  • When you are completed with your basic business service and yet to develop the UI, you are in agood shape to test the business services. Guess what. You don't even have to write a single line of code to test your business layer. JDeveloper comes with an ultra cool support for this. Well, its my personal favourite. I will detail this one when we'll be going through this.
  • ADF provides you with a framework security which you can configure declaratively in a very short time. If you are using the free version of ADF (ADF Essentials) you will not see the security feature.
  • ADF Database navigator is more like SQL Developer. If you have ever used it, you will surely like the database navigator in JDeveloper.
  • When writing business services, you can even enforce business rules using declarative approach. No need to write codes for simple business validations. Also, if you are into a complex validation, you get groovy support for the same. So, using only a few lines of codes, you can achieve complex business validation rules.
  • For UI, you get more than 150 rich Ajax based UI components including graphs, charts etc. You need to simply drag and drop the component you require and your UI is complete.
  • Using drag & Drop features, you can easily wire between the UI components and the business layer.
  • Using task flows you can have a smooth control over UI navigation. Task flows are reusable controller components. So, you can reuse the controller layer itself for various purposes. Here you will also observe that framework is capable of handling two phase commit without much of development effort. We'll see this feature in detail.
  • JDeveloper comes with a deployer which can build and deploy your applications in local or remote host.
  • If you don't like a feature or need cream on top of your coffee, just customize it. That's pretty easy in almost all the layers of implementation.
So, we can see that using JDeveloper, we can pretty much leave many stuffs over the framework and have our peace in mind to concentrate on the core business logic. Well, this is pretty cool feature of JDeveloper/ADF combination.

Come On, everything cannot be a plus. It must have some difficulties too.
Well yes. "There are no free lunch" is true here as well. Not everything is a plus, some minus is also there. You should also check them,
  • As it takes care of most of the things, the deployment becomes heavy.
  • The IDE is a bit slower than Eclipse/IntelliJ.
  • Full version of ADF comes with license fee.
  • The performance of the application is also a bit slow due to internal configuration and caching. But this one is somewhat so small in effect that we can safely ignore. ADF also provides support for performance management. You can freely use this feature.
  • Although it provides a lot of UI components, customizing them is a bit tough.
That's all about an introduction to Oracle JDeveloper.

Now, you have installed JDeveloper in your system and has known about different features it provides. We also took a look on the negative sides of this tool. Now its time to open the tool and have a look on very basics of this tool.

So, launch JDeveloper. It will show a pop up to choose for a particular role.

So, you see we have to choose a role.
Actually JDeveloper customizes the view based on the role selected.
So, if you choose Database Edition over Java EE Edition, you are most likely to miss the view/windows.navigators/tool support for Java. You only see a set of required tools for Database development. Similar is the case for any other edition. If you choose a particular set of tools in the view, it basically increases performance. But again, it all depends on your needs.

So, which one to choose ?
Well, for our cases selecting the Default Role works fine.

Now, if you see below the Role selection menu, you can actually disable this Role Selection for the next executions. Well, I suggest not to do that. Because, you may be working with different projects and technology according to diferent needs. So, better you retain this.

After this, the JDeveloper opens the actual workspace. Now, let's take a look on the views that we see when we open JDeveloper.

So, we can see some major views in the JDeveloper.

Let's detail each window.

Application Navigator

Application Navigator is the place, where you can see different applications you are working with. You can see that we are working with an application which has two different projects. Actually JDeveloper encapsulates all the project into a single big module known as an Application. You may have more that two projects in your application for Developers' convenience but when we build the application, we get a single EAR file for deployment.

Application Resource Panel

Application resource panel shows us the different resources the application using like Database, File System, Application Server etc.

Data Control Panel

Data controls are the main encapsulation of business layer to UI. We'll check this one in detail later.

Structure Window

This window shows us all the structure of the particular selected element.
For example, you page consists of multiple components. Structure window will show you this one in a tree structure for your convenience. My Personal Experience with this view is pretty awesome. It saves a hell lot of search time in the element.

Visual Editor

When you are working with any element in your application, the element is opened in this view. Depending on the element, you can choose different view of the element. Like for a page you can choose between Design View and Source Code view.

Log Window

Whatever you do in JDeveloper comes with a log. Any execution shows some message to this window. Any execution will trigger a new log window.

Component Palette

When you are working with a file in the editor, you see a relevant component list in this window. This allows us to drag and drop the required elements. It also comes with a search box for convenient use.

Property Inspector

Most of the elements in JDeveloper come with a set of properties. You can view all the properties and can configure them according to your needs.
For example, if we are working with a text box element, you can see the different properties you have with a textbox like its size, width, maximum number of characters etc. This helps save the characters you type in for an element. Pretty much of use for a developer.

That's all what we see in the default view when we open JDeveloper. Well, you won't be seeing this window if you are opening JDeveloper for the first time.

We'll be going through the section where we open JDeveloper for the first time in our next article and we'll start with building a very basic application as well.

No comments:

Post a Comment