« MVC design pattern applied to documentation | Main | Subversion extension for JDeveloper is out for testing »

ADF Business Components or TopLink - what to choose?

This is a question that I see from time to time coming from customers who are getting started with JDeveloper and ADF. On the face of it, both TopLink and ADF BC do the same thing - take care of persistence and eliminate a lot of SQL writing for CRUD operations when working with a database. So why does Oracle have both? and which one is right for me?

Well my answer is that each one is suitable for a specific type of developer/project.
Let's face it, not all developers come from the same background and not all developers think the same way.
Basically for the ADF BC vs TopLink debate I'll break down projects and developers into two camps - one is thinking OO and the other one is thinking SQL - if you are thinking OO than TopLink is for you, and if you are thinking SQL than ADF BC is for you.

Let me give you a simple test to see what type of developer, or what type of project you are in.
When you think about your upcoming application do you think: "I'm going to have a department object with a methods exposed that will let me access the department details and also the collection of employees which will be one of the attribute of the department"?
Or do you think more along the lines of "I'm going to have this form were I'll show information from the departments table as the master and also the information about employees based on the Foreign-Key defined in the database?

As you can see these are two different ways to approach the same problem. And I guarantee that if you are thinking like the first sample you'll like TopLink more, and if you are thinking along the second line ADF BC is more up your alley.

The point is that TopLink comes from developers who were thinking in object oriented style and wrote something to make interaction between objects and the database simple. and ADF BC came from guys who were thinking in the way that most 4GL client/server tools were working (Think Oracle Forms, Powerbuilder etc) - which is how do I access these tables in the database and show them on my Form.

So there you have it, it might seem a little bit of oversimplifying the picture - but I think you'll find that this is the best approach for making the choice. No need to look into all the little features that set those two framework apart, just use this simple test and you should be fine.

Comments (13)

Madhav Iyer:

ADF is too complex and too proprietary and locks you in. There is a huge learning curve and you seldom find people with ADF in their resume. I like JDeveloper for other features and not for ADF.

Shay Shmeltzer:

Madhav,
ADF doesn't lock you in. You can use it on any J2EE application Server. You can use it with standard EJBs and JSF and JSP and Struts.
And to make it simpler to learn we came out with the ADF Developer Guide - give it a read to understand what ADF does and how it does it.
This is quite a deep digging book.

Seb:

What's important in my opinion is that Oracle offers standards based and compatible code, best practices (design patterns already implemented for you), performance and tuning (for ADF BC4J) through ADF frameworks.
I think that if you have to produce J2EE apps in a productive way that meet all of this, ADF is a very good choice and has no competitor (many try to fill the gap, but Oracle is far ahead).
It happens that it's effectively Oracle 'The vendor' who did this great job but unlike other vendors (IBM ??), you're not locked in. You take your code and deploy it on virtually every major app server. You can leave ADF whenever you want and return to boring 'manual' JSF + hibernate architecture (tralking about learning curve ? hope you have some very qualified J2EE engineers...) or whatever.
Plus, you have now great documentation and a personnalised support through Metalink although i think it could be better.
ADF Faces is built on top of JSF in a standard compliant way => ADF Faces has joined OS MyFaces project.
ADF BC4J is a huge productivity framework for your business layer and does not make call to any proprietary app server API ie Oracle IAS.
Toplink is the reference standard for JPA / EJB 3.

I don't work for Oracle. I've been evaluating Jdev since 2002.

clark updike:

Shay, you are posing the evaluation criteria based solely an OO versus relational "orientation". I'm guessing there are other aspects of the approaches that might be relevant. For example, wouldn't it be easier to evolve a toplink-based POJO OO model? Doesn't the OR mapping buy you some isolation from schema changes? Are than any others that should be considered?

Thanks.

Shay Shmeltzer:

Clark,
There are many other points that you can consider when choosing your preferred solution.
So for example for your point about toplink offering more isolation from the DB, one thing that plays in favor of ADF BC in the same area is that it has a "Synchronize with DB" option that automatically picks up DB changes and applies them to your components.
The solution I gave is as I stated from a high-level point of view and will usually serve as a good rule of thumb if you can fit your team into one of the types of developers I describe.
If you want to drill more about each one of the options I would suggest reading the two ADF Developer Guides we have out there to get an understanding of the internal working of the solutions.

John Ng:

Hi Shay,

I'm currently evaluating ADF BC with TopLink as a persistence layer. Can you shed some lights as to some of the main advantages and disadvantages, from your experience, of using ADF BC as a persistence layer?

Thanks and Regards,
John

Shay Shmeltzer:

I really believe that this comes down to the type of developer you are.
ADF BC is much more oriented to people who are coming from a database background where they have SQL knowledge, and design their application based on their DB structure.
TopLink is much more oriented to pure OO developers where your application design is focused on UML class modeling.

I would recommend going through the two ADF tutorials at the top of the JDeveloper tutorial page to see the difference in the amount of coding also.

Naresh:

Hi Shay,

I would like to know if BC4J is a good choice if my application contains 90% read and 10% write/update operations ?

Thanks,
Naresh

shay:

Naresh,

ADF BC is a good choice whenever you are doing something with a DB. The fact that you mostly are going to do select type of operations doesn't change this.
(You might want to read the part about read only view objects for this type of operations).
TopLink will also work in this scenario.

Shay

Ning:

Shay,

I am in the same situation trying to understand the pros and cons of the TopLink and ADF.

One thing that I could not get a clear picture is, can they both be used in other IDEs other than the Oracle JDeveloper? Is there a fee involved? I seemed to have an impression that, deployment to other application servers is not free any more. Is it true for both ADF and TopLink applications?

Thanks!
Ning

shay:

Ning,

In terms of license one thing that happened since I wrote this original entry is that TopLink went open source as EclipseLink - so you can get a version of it for free and you can also get a licensed version of it.
ADF BC is part of the ADF framework and is under the ADF license/pricing terms:
http://www.oracle.com/technology/products/jdev/htdocs/jdevpricefaq.html

Technically both TopLink and ADF BC are certified to run on other servers and other databases.

In terms of IDEs that you can use:
With ADF BC - the actual files you develop are XML and Java files that can be edited in any code editor - but if you are looking for the visual and declarative approach to working with these files - the JDeveloper is your tool.

TopLink is a bit of a different story that kind of depends on what type of development you do.
TopLink itself has tooling in JDeveloper and in a stand alone mapper tool.
But TopLink is also a runtime implementation of JPA now - and you can find tools for working with JPA in any modern Java IDE from JDeveloper to Eclipse and Netbeans.

Hi Shay,

I was wondering which is the best approach when using as well relational data as xml data.

BC4J supports xml data in 10g using writeXML and reasdXML and in 11g we can even base an Entity Object on a Webservice.

So BC4J is becoming OO more and more, you can choose declarative of coding approach so depending on skill- and mindset you can choose wizard-like or source-code.

Toplink is standards-based but can't be approached declaratively. How can we dynamically handle relational or xml data and use conditional rendering, conditional business logic, integration with webservices, ...

I would say Toplink is coding and BC4J gives you the choice: coding or declarative approach.

shay:

Nathalie,

Actually in release 11g of JDeveloper we included the TopLink/EclipseLink capability to map to XML data sources as well.
More info here: http://www.oracle.com/technology/products/ias/toplink/oxm/index.html

So again I would say that both framework can work in this case ant it is a matter of development style preferences.

Shay

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)