Shay Shmeltzer's Oracle Development Tools Tips

  • March 10, 2006

ADF Business Components or TopLink - what to choose?

Shay Shmeltzer
Director of Product Management - Oracle

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.

Join the discussion

Comments ( 21 )
  • Madhav Iyer Monday, June 5, 2006
    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 Tuesday, June 6, 2006
    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 Sunday, June 11, 2006
    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 Wednesday, November 8, 2006
    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?
  • Shay Shmeltzer Friday, November 10, 2006
    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 Tuesday, June 10, 2008
    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,
  • Shay Shmeltzer Wednesday, June 11, 2008
    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 Wednesday, August 13, 2008
    Hi Shay,
    I would like to know if BC4J is a good choice if my application contains 90% read and 10% write/update operations ?
  • shay Thursday, August 14, 2008
    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.
  • Ning Friday, September 5, 2008
    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?
  • shay Friday, September 5, 2008
    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:
    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.
  • Nathalie Roman Friday, October 10, 2008
    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 Saturday, October 11, 2008
    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.
  • Sahar Wednesday, October 5, 2011

    Hi Shay,

    Great Post. My project uses ADF BC and I find it great with Synchronize with DB option.

  • guest Saturday, June 15, 2013

    I am totally new to Oracle ADF and now i am in the evaluation phase of the ADF technologies to use it in each and every layer of the new project. With the new project implementation, my client has already setup the database with lot of stored procedures using their DBA team to use in new project.

    With this scenario i am not able to make a decision whether to go with programmatical ADF BC to use stored procedures for all CRUD operations or use the Spring framework to execute the stored procedures by considering the Cache Management implementation. Is DAO's caching using Ehcahce or some frameworks is possible in ADF BC?

    Please throw some light on the deciding the persistence layer ADF BC or Webservices with Spring framework to execute the stored procedures. I understand as per this blog, based on developers experience we can decide on ADF BC or toplink.

  • shay Monday, June 17, 2013

    Guest, I'm not too familiar with the Spring approach for working with stored procedures, however ADF BC definitely has this covered with the programmatic approach.

    Note that by using the ADF BC approach you'll also get the benefits that the framework provides in terms of optimizing DB access (range fetching, LOV etc) and you'll enjoy the benefits up the stack with things like easy binding to the UI.

  • guest Monday, June 17, 2013

    Shay, Thanks for the response about the programmatic approach of ADF BC to use stored procedures. How about the DAO's caching in ADF business components to reduce the round trip between application and database?

  • guest Monday, June 17, 2013

    ADF BC caches data at the EO level and your VO can also be tuned to decide what level of caching it does.

    Check out the documentation for more on this.

  • guest Tuesday, November 12, 2013

    JDeveloper, ADF, ADFm and ADF BC reminds me a lot of an anology created in the book titled "The Mythical Man Month" where it's relatively obvious to someone familiar with athletics that you cannot run a mile in 160 seconds if you can run 100 meters in 10. In our latest design discussion it was decided we would use ADF Faces with JSR standards like JPA, EJB, JavaBean Validations, etc. instead of ADF BC and DTOs instead of ADFm as we are running a marathon. Quite frankly I can't think why you would be using Java EE if you're not involved in a marathon.

  • guest Sunday, December 7, 2014

    Hi Shay,

    Great Post.

    I think JPA/EJP is good known in other java web frameworks but ADFBC is meaningful only in Jdeveloper.Isn't true?

  • Mahaboob Basha Tuesday, February 24, 2015

    Good topic... ADFBC is better and good than Toplink. we can write methods in Ampljavaclasses, row classes, vo java classes and we use it as method call in our application. my opinion is we can use ADFBC in two ways...

Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.