Sunday 3 June 2007

JDeveloper - forget lines of code, data bound web pages in only 29 mouse clicks

Programming language complexity (or how easy development is with the language) is often judged by the lines of code the programmer has to write to generate anything useful. Take the whole Ruby on Rails camp's arguments about how few lines of code they need to generate a database bound web page over traditional Java applications. The "Blah blah 15 lines of code vs blah blah 200 line of code" argument.

Bah! Lines of code, shmlines of pode I say! (I say that with the broad hope that my comment doesn't translate in a non-English language to "My Mother has shingles")

In JDeveloper using ADF Business Components and ADF Faces, a database bound web page showing a table of data, can be created in as little as 29 mouse clicks, without a single line of code written by the programmer!

In fact it gets better than that, because once you've created your first web page, things become even faster! It only takes 12 mouse clicks to create your 2nd web page! That's an efficiency gain of 58%!

Imagine how fast your 3rd, 4th and 5th web pages will be created..... by the time you've finished your application, JDeveloper will in fact be pressing the mouse button for you ;)

Here's the facts, for both JDev 10.1.3.2 and the JDev 11g Tech Preview release:

JDev 10.1.3.2

(This assumes the database connection already exists in JDev 10.1.3.2 and the database is running.)

  1. Start JDev
  2. Right click Applications node in Application Navigator
  3. Left click New Application
  4. In Create Application dialog, left click Application Template poplist.
  5. Left click Web Application option.
  6. Left click ok button.
  7. Right click Model project.
  8. In New Gallery, left click ADF Business Components option left-pane
  9. Business Components from Tables wizard is default option, left click ok button.
  10. In Initialize Business Component Projects dialog, take default connection and left click ok button.
  11. Login dialog accept default username/password, left click ok button.
  12. Left click next button first page of Create Business Components from Tables wizard to skip welcome page.
  13. Page 1 left click right double arrow button to shuffle all tables from available to selected list.
  14. Left click ok button.
  15. Page 2 select the right double arrow button to shuffle all EOs to selected list.
  16. Accept all other defaults and finish the wizard by left click Finish button.
  17. In Application Navigator right click ViewController project.
  18. Left click new option.
  19. Left click JSF option under Web Tier option.
  20. JSF JSP is default option right window. Left click ok button.
  21. In Create JSF JSP wizard, select Next button to skip wizard welcome screen.
  22. On second page select all defaults for wizard and select Finish button.
  23. Left click data control palette (assuming window open by default).
  24. Left click expand icon for default AppModuleDataControl.
  25. Drag and drop first exposed VO onto web page.
  26. From context menu move mouse over Tables option then select ADF Read Only Table.
  27. In Edit Table Dialog accept defaults and press ok button.
  28. Left click run button on toolbar.

JDev 10.1.3.2 2nd web page

  1. In Application Navigator right click ViewController project.
  2. Left click new option.
  3. Left click JSF option under Web Tier option.
  4. JSF JSP is default option right window. Left click ok button.
  5. In Create JSF JSP wizard, select Next button to skip wizard welcome screen.
  6. On second page select all defaults for wizard and select Finish button.
  7. Left click data control palette (assuming window open by default).
  8. Left click expand icon for default AppModuleDataControl.
  9. Drag and drop second exposed VO onto web page.
  10. From context menu move mouse over Tables option then select ADF Read Only Table.
  11. In Edit Table Dialog accept defaults and press ok button.
  12. Left click run button on toolbar.

JDev 11g Tech Preview

(In JDev 11g we create the database connection per application. We still assume the database is running.)

  1. Start JDev
  2. In Application Navigator left click Application dropdown.
  3. Left click New Application option.
  4. In Create Application dialog, left click Application Template poplist.
  5. Left click Web Application [ADF Faces, ADF Page Flow, ADF BC] option.
  6. Right click Model project.
  7. In New Gallery, left click ADF Business Components option left-pane
  8. Business Components from Tables wizard is default option, left click ok button.
  9. In Initialize Business Components Projects dialog select the New button.
  10. In the Create Database Connection dialog enter: A username, Password, Hostname, SID
  11. Left click Test connection button.
  12. Left click ok button.
  13. In Create Business Components from Tables wizard, left click query button.
  14. Left click right double arrow button to move all tables to selected list.
  15. Left click next button.
  16. Left click right double arrow to move all EOs from available list to selected list.
  17. Left click finish button to accept other defaults.
  18. Right click ViewController project.
  19. Left click New button.
  20. In New Gallery, left click JSF option under web tier option.
  21. Left click JSF JSP option in Items list.
  22. Left click ok button.
  23. In Create JSF JSP dialog, accept defaults and left click ok button.
  24. Left click Data controls palette option under Application Navigator window.
  25. Left click the expand icon on the AppModuleDataControl.
  26. Drag and drop exposed VO onto web page.
  27. From context menu move mouse over Tables option then select ADF Read Only Table.
  28. In Edit Table Columns dialog accept defaults and press ok button.
  29. Left click run button on toolbar.

JDev 11g 2nd web page

  1. Right click ViewController project.
  2. Left click New button.
  3. In New Gallery, left click JSF option under web tier option.
  4. Left click JSF JSP option in Items list.
  5. Left click ok button.
  6. In Create JSF JSP dialog, accept defaults and left click ok button.
  7. Left click Data controls palette option under Application Navigator window.
  8. Left click the expand icon on the AppModuleDataControl.
  9. Drag and drop exposed VO onto web page.
  10. From context menu move mouse over Tables option then select ADF Read Only Table.
  11. In Edit Table Columns dialog accept defaults and press ok button.
  12. Left click run button on toolbar.

..... yeah yeah yeah, obviously this is a bit of joke, and don't take it too seriously. Of course you'd never see such a hard hitting blog post from Oracle's blogging team ;)

But it's nice to show how easy web page development is in JDeveloper with ADF BC and ADF Faces. And without needing to write a single line of that "Evil Java Code" either ;)

No comments: