Thursday, June 16, 2011

Fine tuning your logical to physical DB transform

When you use JDeveloper's class modeler to design your logical database you are able to run the DB Transform to get a physical DB model. But have you ever been frustrated at the limitations of the transform? for instance -
  • name to be used for the physical table
  • attribute to be used as the PK column
  • datatype and settings to be applied to a specific attribute
  • foreign key or intersection column names
  • different datatypes to be created for different database types
In JDeveloper 11.1.2 additional fine grain and reusable transform rules are available to you using a UML Profile. This is a UML2 concept but for database designers using JDeveloper it means you can set many properties at the logical model that are used when the transform to physical model(s) is run.

There is a section in Part2 of the tutorial Using Logical Models in UML for Database Development that details using the DB Profile, so I will not repeat the whole story here, but give you a flavour of the capabilities. Once you've applied the profile to the UML package of your class diagram you can set stereotypes against any element in your diagram. In the image below you are looking at the stereotype properties of the empno attribute - that will become a column in the database. Note that this column is to be used as the primary key on the table. Also note the list of Oracle and non-Oracle datatypes listed. Here you can specify exactly how empno should be transformed when multiple physical databases may be required. If the property for any of these is not set then the default transform will be applied.

You could say that having this ability as part of the class model bridges the gap between this model (being used as a logical DB model) and the tranformed physical database model - it provides some form of relative model capability.

Looking at another new feature in, the extract right shows other elements on the class diagram. I've created a primitive type (String25Type) and using the stereotype have specified how this type should be transformed. Now I can use that type on different classes in my diagram and the transformer will use it as necessary.

There are many other ways to fine tune your transform, run through the tutorial and try them for yourself

Hudson and me!

Over the past months I've been working more and more with Hudson, the continuous integration server. If you're familiar with Hudson then no doubt you are familiar with the changes that faced it in that time. If you're not - well, it's a long, well-documented story in the press and I will not bore you with it here!

But the most important thing is that Hudson is a great (free) continuous integration tool and continues to grow in popularity and status. Oracle became its supported from Sun's original open source project. As well as its community of users and developers Oracle has a full-time team working on it, including me as Product Manager, and it recently started the process of moving to the Eclipse Foundation as a top-level project.

Internally we use Hudson across the organization for all manner of build and test jobs and I know that many of you do too.

In JDeveloper 11.1.2 we've added new features to Team Productivity Center (TPC) to integrate Hudson (or Cruise Control) build/test results into the IDE and relate those to code checkins via the TPC work items. You can see a quick demo of that here

If you use Hudson I'd like to hear from you - in fact, I'd like to hear from you anyway! So please contact me at the usual Oracle address. Other ways to keep up with Hudson are through its mailing lists, wiki and of course twitter - @hudsonci

Tuesday, April 26, 2011

After all these years I've finally got my first major article published in the ODTUG Technical Journal. I'm really excited as it's about Database Design Using JDeveloper - from Logical to Physical modeling and more. This is not a topic that normally attracts that much attention outside of those of us who know all about its merits so I'm especially happy.
And just like buses, you wait ages for one and then two come at once (if you're outside the UK this might not mean much to you!) I'm now writing a second deep dive into JDeveloper's Logical modeling, and some fantastic new features that are coming your way, for the next quarterly issue due out around the time of Kaleidoscope, the ODTUG conference. Unfortunately I am not able to attend this year, but if you happen to be Long Beach Way in June - you should try and make it.

Monday, May 10, 2010

Converting a CVS repository to SVN

I've recently gone through this with an old CVS repository we have. We wanted to keep the history but not the CVS repository. I used cvs2svn from with great success.

This converter actually converts from CVS to many different repositories including git. It offers many options for conversion - I created an SVN dumpfile but you can also convert directly into an existing or a new SVN repository.

I chose to use the options file to run my conversion - so I could play with the different options, do dry-runs, adjust what output I needed etc. Here are some of the settings I used from the cvs2svn-example.options file that comes with the converter

ctx.output_option = DumpfileOutputOption(
dumpfile_path=r'/cvs2svn-susan-output/cvs2svn-dump1', # Name of dumpfile to create
### to output conversion to a dump file

ctx.dry_run = False ### always a good idea to do a dry run!

ctx.trunk_only ####I decided not to bring over any branches and tags

r'/cvs-copy', ##### to specify the repos project to be converted

For my conversion I didn't need to use many of the other possible options such as mapping author names and symbol handling. I was confident that, as I had used JDeveloper to populate my CVS repository, this had been handled for me. For instance, I didn't need to do a lot of prepping of my CVS repository to ensure that my binary files had been correctly added to the repository. This can be a problem as CVS and SVN handle them differently. The documentation at Tigris and the options file are very detailed in how to handle these potential issues.

and that's really all there was - just run the converter and point to the options file
cvs2svn --options=MYOPTIONSFILE
I then created a new Remote Directory in my target SVN repository using JDeveloper's Versioning Navigator and ran the standard load utility on the command line to add my converted CVS repository to my existing SVN repository.
svnadmin load /svn/mySVNrepository/ --parent-dir mynewSVN_dir < /cvs2svn-dump1
A check that my workspaces checked out correctly and that I could see my image files and I was done (sorry to all my QA colleagues who want more testing mentioned than this!)

Tortoise and JDeveloper

Recently I discovered a new setting that could trip you up if you are using both TortoiseSVN and JDeveloper to access your SVN repository from an OTN forum post.

If you are finding that you can't see the overlays on your JDeveloper project files or that some of the menu items are not enabled - make sure that in your TortoiseSVN settings you have unchecked Use "_svn" instead of ".svn"

Anyone got any other tips for using both tools?

Tuesday, March 23, 2010

Filtering Your DB Objects in the Application Navigator

I'm working with a customer who is using JDeveloper to manage his database object defintions. He has created an offline database by reverse engineering his very large database and uses our built-in integration with SCM systems (Perforce in this case) to version those objects and manage them at the object level.

Because he has such a large number of objects I've been thinking of ways for him to view the objects he wants to see and work with more quickly.

To illustrate this post I'm using an offline database I'm working on at the moment. And as you know me (read the post - 8 Things You Didn't Know About Me) you wont be surprised to see that Blues features strongly!

So, how can I view my offline database objects? First, utilising the Navigator Display Options. I can quickly go from an alpha- listing of my objects to listing them by object type by simply deselecting the Sort by Type option.

Alternatively I can use Working Sets to filter out object types. In this example I'm hiding sequences and triggers by adding a File Filter to hide the other database object types (in my example I only have tables, sequences and triggers currently). With this in place I can see that the files to be displayed are as I want them.

Finally, I've saved this working set as 'Tables Only'. I can now go on and develop my Working Sets to cover other listing that are appropriate to my model. This could mean filtering files by name, folder or by type.

Working sets were initially developed for filtering large Java EE applications, but work equally well in the database domain

Wednesday, December 16, 2009

Making Merge, Revert and Branching Easier with SVN

In the latest release of JDeveloper ( we've added new declarative UIs to help simplify those most crucial and complex of SVN tasks - Merging and Branching. These SVN operations can be tricky. They involve ensuring that you pick the correct location in your repository, the correct revision, and mistakes can be costly and time consuming to fix.

Take a look at the wizard below. This is available whether you choose Merge Working Copy or if you want to Merge a single file. My top tip is that you should almost always use Merge Working Copy, especially if you are working with ADF (Application Development Framework) as many of the XML metadata files for your application will have dependencies on Java files and ending up with missed or out of sync files on a merge of any sort can lead to problems.

In previous releases we simply gave you the ability to enter your URLs and revisions, almost as you would if using the command line to access SVN. But in JDeveloper we pride ourselves on providing declarative help for developers. This wizard is invoked from a checked out application context - so you are always working within your working copy.

In this first step you choose the type of merge you are undertaking, for instance Merge Selected Revision Range is used if you want to update a branch with changes from the trunk. Let's take a common scenario: User 1 is working on Branch 123_susan. She knows that primarily her work will not cause any conflict with other work on other branches or the trunk so she has not worried too much about merging the latest trunk code into her branch. However, she comes across a problem and asks User 2 to fix something in the trunk so she can progress. She is told the revision that contains the specific fix she needs so she uses Merge Selected Revision Range to get that revision into her branch. The dialog below shows the path to trunk/blues as the source and her working copy - her branch - is the destination for the merge.

The revision to be merged - 275 - was picked using the List Revisions dialog. This dialog is used whenever revisions need to be browsed or selected. Notice that selecting 275 in the top panel shows the details of that revision - the comments, the files, the action and the author
Now the user can complete move to step 3 of the wizard, choose other merge options and carry out a test merge to check her work and finally complete the merge of that one revision into her working copy. Finally, she will commit her working copy back to its branch on the repository as normal.

Once she has completed the work on her branch she will be ready to use the Re-integrate A Branch merge to get it back into the trunk of the development. As always, the way to do this is to carry out any merge into a local working copy and then commit. So the first step for the user is to do a final commit of her branch. At this stage she can remove her branched working copy as it is finished with. She checks out the latest trunk revision and now she is ready to merge her branch to her new (trunk) working copy. Let's look at that another way:

1. A branch is created from trunk
2. User 1 checks out working copy from branch and edits code
3. Commits back to branch periodically
4. User 2 commits revision 200 to trunk and User 1 merges that revision to the working copy
5. Finishes coding working copy and commits to branch
6. Checks out new working copy from trunk
7. Merges branch into working copy
8. Commits working copy back to trunk

Before Subversion 1.5 the merge of a single revision in step 4 would have caused problems when the final merge of the branch back to the trunk was done (step 7). But SVN now has merge tracking so it keeps track of the revisions that have already been merged so that the final merge of all revisions goes ahead without error.

The third merge option is Merge Two Different Trees. This allows you to compare two different branches and merge and differences back into your working copy. This is the most complicated and, I would say, the least used of the merges.

One final tip - what if you want to revert your working copy to a specific revision? Use the Merge Selected Revision Range option. In List Revisions select the range of revisions from the latest to the revision you want to revert to and click OK. This will enter the range. But the range list will be ascending - eg 258-359. To revert to revision 258 simply reverse the range order and hey presto! a revert back rather than a merge up will be done - try it out in the test merge panel to check it - and you're done!

Tuesday, December 15, 2009

Working with Versioned Database Models

What? 3 posts in 2 days? After months of silence? Isn't it amazing how time flies. Here in the JDeveloper Product Management group we've been busy all year with releases and conferences and many opportunities to get out and talk to people about the great features in our tool. But as the year draws nearer to a close and all the traveling is over I've finally got time to get out on my blog some of the things that I've been evangelizing about all year. As you'll have noticed, one of those is the great new functionality that we've introduced in database modeling.

Periodically I'm asked why we don't introduce a database repository to store database models. One that can be queried and can store versions of the modeled objects? We've been down that road (those of you who've been around for a while know what I'm talking about!) but think that what we have now in JDeveloper is much more flexible. What is it that you want from a repository? Amongst the most important answers to that question is the ability to store multiple versions of your database objects, to query and to compare them.

In previous posts I've demonstrated how you can use our Database Reporting to query your database models and output the results. In this post I want to show you how you can use JDeveloper's integrated versioning system capabilities not only to maintain multiple versions of your database model but how you can resolve any conflicts that arise when multiple users update the model, using a declarative interface.

In this example I am using Subversion (SVN), one of the versioning systems that is integrated in JDeveloper. It is an open source system, widely used in the application development world. I am not going to step through a complete process for versioning in this post, there are various tutorials, how-to, demos. white papers available on OTN and if you want more information on SVN there is a very good online book.

Here is a part of my application. Note that it contains an offline database model (Blues) and one schema (GOTTHEBLUES) containing a number of database objects. This is a project that I'm currently working on. It is stored in an SVN repository - each of the objects has a revision number next to it. Notice that the PERSONS table is at version 378. In SVN the repository revision number is advanced each time a check in of files is done. So this does not mean that the PERSONS table has been checked in 378 times, it shows that the last time PERSONS was checked in the repository moved to version 378. Likewise the last revision of PUBLICATIONS is 258, so PUBLICATIONS has not been changed since revision 258.

If I open PERSONS from the navigator - I get the declarative UI that allows me to edit that object. But that is not how the information is stored. JDeveloper stores its database models by object - in XML. Below is an extract of what you would see if you opened the underlying file PERSONS.table in a browser.

It's not impossible to read - the extract shows the detail for column LAST_NAME, a VARCHAR2 of length 25, with a comment that it was created via a DB Transform (from a class model). However, the declarative UI abstracts you from the raw XML.

But imagine if you needed to compare two versions of the PERSONS table - or you had two users who were both working on the PERSONS table and checked in their changes to the SVN repository? Comparing the raw XML files is possible, and JDeveloper does recognize XML formating, but in the latest version of JDeveloper ( there is a new declarative UI for that too.

Imagine this scenario: two users have checked out the latest version of the application. SVN uses a copy-modify-merge versioning approach. This means that when an application is checked out a copy of that application is created on the user's local machine. SVN does not keep a record of who and where copies are checked out. It is only interested when something is commited back to the repository. So, as a user I can check out a working copy, make changes to it and if I never commit those changes back to the repository, so be it. I could do some 'what if' type coding and then decide to discard the whole copy.

In my scenario the two users have been discussing the PERSONS table and agree that the length of the LAST_NAME column is too short at 25. Unfortunately, they both decided to modify the column length in their working copy. User 1 happens to be the first to commit her changes back to the repository - so it now has LAST_NAME with a length of 50.

Now user 2 modifies her working copy, editing LAST_NAME to length 40. As good practice dictates, she Updates her working copy with the latest revision from the repository - so she can resolve any code conflicts in her working copy prior to merging her copy back in.

In this case she finds that she has a conflict between her code and the repository that JDeveloper cannot resolve automatically. She sees this in her Application Navigator. It shows the PERSON table with a conflict overlay and the differing versions of the table are also listed (see below)

But help is at hand. Double-clicking on PERSONS 379 opens the three-panel Merge window. On the left is her local version of PERSONS - with length 40, on the right is the repository version with length 50. After reviewing this she has shuffled her version into the middle Result of Merge panel. As that was the only conflict in the two files the Save and Complete Merge icon is enabled in the toolbar.
Once she saves this merge and refreshes the Application Navigator the extra conflict files will disappear and the updates will be applied to her working copy. Now she is ready to commit her working copy back to the repository so that it reflects the latest code position.

Not all changes made by multiple users cause conflicts. If the changes are complimentary - for instance one user adds a new column LOCATION and another uses changes the type of PERSONS_TYPE these changes will be added to the repository as SVN and JDeveloper recognize that there is no conflict. This is how SVN works by default, copy-modfy-merge in action. Many systems work this way, and others use the lock-modify-unlock paradigm.

If you want to review changes to a database object prior to updating your working copy, you can use one of the Compare options (Compare with Latest, with Previous, with Other Revision) before you update your working copy with the repository contents. In the example below, user 1 has used Compare with Latest to check her changes: A change to the size of FIRST_NAME and a new column COUNTRY - as shown in the right hand panel with the latest version in the repository (as shown in the left hand panel).

Finally, in this post, a short list of other tips
  • Using Compare with Other Revision don't forget to scroll to the right - and see not only revision numbers but the commit notes. Also use the filters optimize the revisions listed

  • If you make changes to a file but want to revert back to the version you checked out from the repository - use menu Versioning - Revert

  • Use the graphical Version Tree to review branches and versions of your objects

Visualizing the DB Reporting Metamodel

In my last post I gave examples of using both the pre-built reports and building custom reports on your database models.
As a P.S. to that post I want to point you to the JDeveloper Help system that comes with diagrams to help you define and understand the Database Reporting metamodel. Below is the JDEV table of contents - open at Working with Database Reports

and one small part of the Tables Report Metamodel to give you the idea. Have fun!

Monday, December 14, 2009

Using Database Reporting to Ensure Standards Compliance

In JDeveloper 11gR1 we introduced a SQL-like interface for reporting on your database models. Watch this demo to review the basic functionality. In the latest release we've added a set of pre-built reports. These reports not only get you started with reporting but also illustrate how you can use database reporting to ensure that the objects in your offline database model comply with your team's naming standards.

I say SQL-like interface because the database model you develop offline in JDeveloper is stored in XML. However, we took the decision that as most database developers are familiar with SQL it made perfect sense to provide a familiar way to interrogate the model. For instance, the pre-built report to list all tables with no Primary Key is:

T.SCHEMA '.' T.NAME "Table"

As you get more familiar with the meta-model you might write your own SQL queries, but there is also a declarative UI to help you traverse the model and develop the query you want.
Below is an image of the wizard, showing how the FROM clause for the above query is selected. You can also select the objects, apply different JOINs, add a WHERE, GROUP BY and aliases using the declarative UI.

Here is an example of a more complex SQL query - to report on any tables that do not have the audit column CREATION_DATE*


Now the world is your reporting oyster - how about creating a series of reports in a Standards Project - and distributing that project to every team that is doing database development? Here is one approach:
  1. Check the Standards Project out of source control into the required application
  2. In the Standards Project open the Project Properties, in Project Source Paths select the Offline Database node
  3. Add the projects containing your database model project(s) - see image below

  4. Open each report (double-click) and select the offline database you want to run against
  5. Go to the Publish tab and enter the details of how and where you want the report to be save. In the example below I've chosen to save the report in the project that contains the database - so my audit reports can be shown to represent my offline DB Model.
  6. Use the context menu of the report format to Run the report. In my example the HTML version of the report (AuditTableCheck) is now stored in Project1 along with the database, the report format (Check_Audit_Tables) is stored in the Standards project along with the other report formats.

Let me know how you get on - it would be good to build up a list of reports written by you that could be shared with others.

*For a full example of using this in a tutorial see this Oracle By Example

Monday, September 21, 2009

Announcing new Oracle Development SIG in the UK

On the 27th of October, the UKOUG are launching a new Development SIG aimed at any developer who is developing using Oracle tools and technology. The first special interest group (SIG) will have a "modernization" theme to it and covers topics as including Apex, SOA, Forms, Designer and JDeveloper.

A full SIG agenda is published here.

As usual with these events, space is limited and given the wealth of experienced presenters and topics, it should serve as a great learning opportunity as well as the chance to exchange ideas and meet with fellow developers.

Monday, July 20, 2009

Team Productivity Center Tutorial Published

There is now an Oracle By Example (OBE) tutorial available for TPC. It takes you through a number of topics including, on the admin side, setting up teams and integrating with repositories and, as a TPC user, querying repositories and creating relationships and tagging items across repositories.

It assumes that you have already installed or have access to TPC on the server. If not, here are instructions on doing that. The OBE includes images and examples using JIRA and MS Project Server but for a tutorial on the Rally Software integration, explore their site

And, as always, give me your feedback!

Thursday, July 16, 2009

Connecting with Team Productivity Center

Well, it's been quite a couple of weeks. TPC was featured in the developer tools section of the Fusion Middleware 11g launch and got some good press coverage (for instance eWeek) and the bloggers were our in force. You can watch the launch and see Duncan Mills use TPC in his demo. He has also recorded an Oracle Videocast and Podcast introducing TPC.

My aim is to get as many users to download and use it as possible (actually, that is every Product Manager's aim for their product!) That is going well, but I could do with your help to get the news out there. The ALM repositories we integrate with currently are all leaders in their field. The JIRA integration is a great productivity booster and the more I work with JIRA the more I realise how flexible it is. Microsoft Project Server is widely used in enterprise organisations and Rally Software is a world leader in agile development.

We are working on additional connectors (more news on that when I can divulge more) but there is always room for more. I'd love to hear from you on what ALM repositories you would like to see TPC integrate with. I'd love to hear from you if you have an internal system you would like to write a connector to integrate it with TPC. In fact, I'd love to hear from you in any capacity concerning TPC - and that, of course, includes those of you who have reported bugs too ;-)

John Stegeman, an Oracle Ace Director, is interested in creating a connector to TRAC. He announced this with a JDeveloper forum post saying, " I've been thinking about writing a connector for an issue management system that I use (of course, there had to be a selfish reason), TRAC. I think an ideal way to do this would be with a small team of developers working together on the new sample code site hosted by Oracle ( "

I think this is a great idea. It would be about a month of effort and you would get the opportunity not only to get to know our connector framework but to work as part of a small team and gain experience to perhaps go on to creating a connector for something within your own organisation. You can contact John through the forum post. I would highly recommend it (well, I would, wouldn't I?)

So, download, use, report, connect, and code - yep, that about covers it!

Wednesday, July 01, 2009

Introducing Oracle Team Productivity Center

Today is an exciting day for me. It's the launch of Oracle Fusion Middleware 11g in the USA and tomorrow the launch event comes to London. Included in this launch is, of course, Oracle JDeveloper 11gR1.

For some time I've been working on a new aspect of JDeveloper - Oracle Team Productivity Center. It is our first release of functionality to enable better Application Lifecycle Management for JDeveloper users and it is included in Oracle JDeveloper 11gR1.

TPC introduces the Team Navigator to JDeveloper. Through this navigator I can set up my team and user structure, applying team roles to users in teams/projects. I can connect to my existing ALM repositories and query/update artifacts in those repositories while working in JDeveloper.

In addition I can contextually link artifacts from different ALM repositories together - so I can create a relationship between a requirement defined in JIRA and a task in MS Project Server and I can tag items (needs a use case, ready for code review etc.) that are either visible to me or to all the members of my team. And I can be a member of multiple teams too. If I'm working on one task and am asked to switch to some other piece of code I can save the state of my development files open in the IDE against a specific work item. Work item is the generic term we give to any ALM artifact queried from an integrated ALM repository. So in the example below, I am working on a JIRA issue - SSTORE-23. If I Save Context I will save the Business Component files open in the editor along with the position and sizing of all the other JDeveloper windows. Then when I come back to this piece of work I can re-open SSTORE and Restore Context - to return my IDE to the saved state. Another great productivity booster!

A database is used to store queries, relationships, tags etc and managed by a small JEE application. This is set up by the installer and the client-side workings are downloaded through the normal Check For Updates Center in JDeveloper.

In this first release, in addition to the adaptors developed by us to connect to JIRA and MS Project Server I'm really pleased that we have partnered with Rally Software.

Rally is the leader in Agile application lifecycle management (ALM) dedicated to making distributed development organizations faster and leaner by dramatically cutting the time, cost and effort needed to deliver high quality applications. Rally's products were honored with four consecutive Jolt awards (the software industry's equivalent of the Oscar® award) in 2006, 2007, 2008 and 2009. The company's end-to-end solutions for Agile development also include Agile University, the largest source for Agile training, and Agile Commons, the largest collaborative Web 2.0 community dedicated to advancing software agility. Using the Rally Connector JDeveloper users can view and update their Rally tasks and defects directly from JDeveloper.

This release of TPC concentrates on enabling JDeveloper users, but Application Lifecycle Management is about more than just developers - it has a role in breaking down functional silos (development, QA, Doc, PM....) and it's our aim to push TPC out to more than developers going forward - both in terms of increased services provided by TPC and increasing the number of connectors available to differing ALM repositories (requirements, task, defects, testing etc)

One step towards that goal is the provision of a Connector Developers Guide and a sample connector to allow other third parties to create connectors to their existing ALM tools - be those commercial products or in-house systems.

But that's not all - JDeveloper users can also integrate their XMPP chat system into JDeveloper - even more productivity for developers without the need to leave their IDE! I can who of my team mates is connected to chat and also chat with all my buddies - whether they are working with TPC or not.

This is just a very brief introduction to Team Productivity Center. Browse the link above for more information, download, install and try it out - and let me know what you think ;-)

Saturday, June 13, 2009

ODTUG 2009

I can hardly believe it's another year (of few posts to my blog) and another ODTUG Kaleidoscope conference is almost upon us. This year the conference is in Monterey so I'm packing my bags and off to Oracle Headquarters in San Francisco tomorrow - then down to the conference on June 20th

If you have the opportunity I'd urge you to try and make it there too. The 'fun' starts off on Saturday when there is a community service day. Last year we painted school classrooms in New Orleans, this year we are helping to restore habitat at Martin Dunes, California’s largest and most intact dune ecosystem. So I'm packing plenty of sunscreen as my pale English skin isn't used to the California sun! More fun after the first day of sessions Sunday - with the second ODTUG Jam Session. Those of you who know Grant Ronald and I know that we are much too shy and retiring to join in that ;-)

But of course, that's not all the fun. The conference is full of interesting and diverse sessions - and I should know, I was part of the panel reviewing papers for the Editor's Choice award - I spent a few evenings reading papers on everything from project management to Oracle to the Holy Grail.

As for me, I'm really excited to be doing two sessions -

5000 tables, 100 schemas, 2000 developers: This will showcase some of the team-working features such as standards and version management, and reporting and impact analysis and the highly usable and scalable data modeling in JDeveloper. I've got some great new functionality to reveal - reporting on your data models, user defined validation and declarative compare of versioned database objects

Tooling up for ALM 2.0 with Oracle Team Productivity Center: If you were lucky enough to be at Oracle World or the UK Oracle User Group conference last year you might have seen a very early incarnation of this project that I've been working on. At ODTUG I'm going to be demoing the very latest code and showing you how to use your ALM repositories from within JDeveloper and how to integrate artifacts from those (maybe) disparate repositories together through Oracle Team Productivity Center. All this and team management too!

Another goal I have for the conference week is to talk to as many JDeveloper users as possible about team working, ALM and SDLC - and to ensure that I get feedback to take back and work on more functionality in JDeveloper to compliment the great application development tool we have

I look forward to seeing you there - or if not, finding other ways to talk to you!

Back to Top

Tuesday, August 12, 2008

DD Tips and Techniques - 2 Displaying Shapes

When I said occasional in the last blog - I didn't specify the time interval - so here is a second post in as many minutes!

There are a number of ways to tidy a cluttered diagram. Sometimes you don't want to see all the columns/constraints in the table shape, or perhaps you only want to see some of the columns - the keys or the most important columns:

View As -> Compact
Select shapes in a diagram and use this context menu to completely remove any columns or constraints from the shape

Hide Selected Shapes
If you want to show only some of the members of your shape (for instance only the keys and major columns in a table) select members you want to hide and use this context menu. The members are cut from the diagram but are still available to you through the shape editor. To see all the members again use Show All Hidden Members

Tools -> Preferences -> Diagrams -> Database
Under this node you will find many different options for your database diagram - you can change font, shape colors for many different database shapes. For instance - select Table from the dropdown list and uncheck Show Constraints if you want to exclude them from the diagram. Note that changes made in this way only apply to new shapes added to a diagram. So it's good practice to check your preferences before you start work on a diagram

Database Diagramming Tips and Techniques - 1 Keyboard Accelerators

I'm working on a new database design and thought I'd pass on some of the tips that I use to aid my work. As always with my blog entries, this will be an occasional series.

Keyboard Accelerators - diagram cleaning aid

I often create new offline database tables using a database diagram. I can visualize and edit objects in-place easily and often. But having to resize the shapes and tidy up the relationship lines can be very frustrating! So I do the following:

First the setup -
Go into Tools -> Preferences -> Accelerators
Scroll down the Actions list and select Height and Width
Add a new accelerator (if none set) - I use Ctrl H
Scroll to Select All and check what accelerator is set - default is Ctrl A
Scroll to Straighten Lines and add an accelerator - say Ctrl L

Now, in my diagram whenever I can't see all the info in my table shapes I either select the specific tables and do Ctrl H or do Ctrl A + Ctrl H to resize all my shapes followed by Ctrl L to straighten the lines.

Easy Tip No1!

Monday, June 09, 2008

Checking who else has checked out?

A comment on an earlier post has prompted me to clarify the way that Subversion handles certain tasks. The commenter is using SQLDeveloper, that uses JDeveloper's SVN implementation, and wants-

1. Subversion navigator to indicate if others are working on the same code

Subversion uses the copy-modify-merge paradigm. This means that any user with the correct authorization can check out a copy of the code from the repository to a local file system. This local copy can be manipulated (using JDEV, Tortoise, command line etc) so that updates and commits can be carried out from it. However, the Subversion repository does not have any understanding of how many users are working on or have checked out the same code. Updates and Commits are instigated from the local copy. This also means that any local copy checked out from Subversion may never be checked back in.

2.When double clicking on a package in the database or in the versioning tree and have the option to load the local copy (linked to subversion).

With respect to the request to double click on the versioning tree this comes back to Subversion having no knowledge of the local copies. I think that he is asking that the local copy be updated through using the Subversion navigator - but updates are driven from the local copy, not the repository.

As for the database package, that would be another level of complexity. Presumably the single point of truth is the package definition held in the SVN repository. To ensure that the database holds the latest version the user would have to checkout a the latest version as a local copy from the repository and update the DB. I'm not sure that somehow automating this process would be desirable - it would need links from the DB to the tool to the correct local copy location and through this to the SVN repository - sounds error prone to me.

3. Be able to do a compile and see the log window

This is a SQL Developer question, rather than SVN oriented, so I'll leave that to my colleagues with SQLDeveloper to answer.

Friday, June 06, 2008

Going To New Orleans - ODTUG Kalaidoscope 2008

I've traveled and spoken on Oracle all around the world at many events but this year will be my first at ODTUG (June 15th-19th). I'm looking forward to both the technical and the non-technical aspects of the conference. New Orleans is somewhere that I haven't visited in 15 years and I'm happy to be one of the nearly-75 strong ODTUG Brigade volunteering for a day of community service work to give back to the city that has given so much to music lovers and so many others like me.

The conference is packed with keynotes and sessions, I'm going to be presenting two:
Who Moved My Code? - Team Development in Oracle JDeveloper on Wednesday 8.00-9.00am
Seven Secrets (and more) of Successful JDeveloper Database Designers on Wednesday 2.45-3.45pm

Both of these will be predominantly demo driven sessions. In the first Lynn Munsinger will be joining me so we can demo multi-developer tips and tricks using Subversion. The Seven Secrets will focus on existing and new features for database development and visualization for application developers. I'm hoping also to squeeze in a sneak preview of a project I'm working on around Application Lifecycle Management. Please join me if you are at ODTUG as I would welcome your feedback.

Our Usability Research Team is running some feedback sessions that Lynn, Grant Ronald and myself will be attending, be sure and sign up for one of those. Plus, if you want to talk to us about any aspect of JDeveloper we will be in the exhibit halls ready and willing to demo and discuss.

Finally, I hear there is a ODTUG Jam Session and I'm pretty sure I wont be able to resist!

New Best Practices Paper for Subversion and JDeveloper

I've finally got around to pulling together some of the information and best practices that I've blogged about into a document. You can view it here on Oracle Technology Network. Let me know what you think

Tuesday, April 22, 2008

ALM - help me help you!

Some of the areas that I've always been interested in - as a consultant, a teacher, a curriculum developer or as a Product Manager - are standards, methodology and development process: From Designer to JDEV, from CDM to Agile, from ClearCase to SVN, from IE to UML and so much more. Now we call that ALM - Application Lifecycle Management - the management of the lifecycle development practices (requirements, build, test, change control, defect mgmt etc) fused together through application of process, reporting, traceability and collaboration.

Here in JDeveloper land we are always looking at ways to improve both our tooling and the developer experience so I've put together a survey to find out what ALM tools you are using today. We're looking into adding better integration with ALM tools and the results of the survey will ensure that we move in the right direction.

So please, take a couple of minutes to complete this quick online survey and help me help you!

Friday, February 08, 2008

Evil Clones - The SCM nightmare that can stop you in your tracks

It can happen to anyone. First the feeling of disbelief, then the cold sweat; you try pinching yourself, hoping it's some bad dream and you'll wake up and they'll be gone . . .

There, that's my catchy first line of my first novel written, now just the other 150 pages to invent. But unfortunately it really can happen to you - if you are working with ClearCase you may have come across evil twins. But I want to talk about a different nightmare that can occur if you are using SVN or CVS.

Here's the scenario. You and a team member are both working on a file (let's call it MyClass1) checked out of SVN.

Your colleague, as part of her edits, renames MyClass1 to CloneClass1 and commits the working copy.

SVN uses copy/delete commands for a rename:
First MyClass1 is copied (so that the history is maintained) to CloneClass1.
Then MyClass1 is deleted from the repository.
The screenshot of the SVN repository (left) shows the new resulting file with CloneClass1.

CVS is not quite so clever is uses add/delete: It adds CloneClass1 and deletes MyClass1 - so none of the history of MyClass1 is copied to the new CloneClass1.

But back to the SVN example. You have edited the checked out MyClass1 and are oblivious to your team member's edits. Not a problem, you might think as an update from the repository would absorb the changes or at the very least show you a conflict over the rename. Unfortunately not!

Here is where the nightmare that I'm calling Evil Clones appears.

The repository rightly updates your working copy with CloneClass1. But wait, your class MyClass1 is not only still in your App Navigator, but is no longer under version control!

If you think about it, this is correct -
  • SVN has replaced MyClass1 with CloneClass1. It has no recollection of the object MyClass1 so there is no merge of MyClass1 and CloneClass1.
  • You wouldn't want to lose the additional changes you have made to MyClass1 in your working copy - and it is not under version control - well, it's not, because it doesn't exist in the SVN repository
  • You can easily recognize that MyClass1 has been replaced by CloneClass1 so it's a simple job to move your changes to CloneClass1 - or is it. . .
This is expected behavior from Subversion and it seems that they recognize it as a bug . The example above is very simple. But what when you have 00s of different files in your working copy?

I'd be interested in how you work around this shortcoming in SVN. Here are some of my thoughts:
  • Don't rename, if you think you must, think again!
  • If you must, then refactoring or plain renaming of files (this is not specifically a Java problem, could be XML metadata, diagram or any other file type) should always be taken seriously in team development. In our JDeveloper development teams it's usual for the developer thinking about renames to email colleagues, check for dependencies and most definitely comment both the code, the check-in and the build notes to minimize the possible problems.
  • How renaming is handled in your team should be part of your defined development process. It should take account of your source code system, your build system and provide workarounds as necessary
  • If you are using JDeveloper and find that one of your objects appears to 'lose' its versioning status after an update - think rename!
  • Always ensure that you fully comment a rename on commit so that other users can use the log to find out where and why their object was deleted from the repository
In a forthcoming post I want to look more closely at how you detect and work to correct a rename problem. Specifically I want to use JDEV's offline database objects to do this. In the Java world developers may be more aware of the power of refactoring. But, as I said above, this is not a problem restricted to Java. I want to highlight the effect on XML and database objects.

At what level should I version my source code? - Alternate Takes

So now you know that I'm a Blues fan. One of Blues most revered artists was Robert Johnson. There are only a very few recordings of him - done between 1937 and '39 - just 29 different songs, but there are alternate takes bringing his total recordings to around 40 songs. Maybe he was striving for perfection, maybe different styles suited different audiences or even his moods, but these alternate takes add to the legacy left by him. Some blues fans have their own favorites but I love them all!

Recently I've been speaking with a number of JDeveloper/SVN users concerning the level at which they version their code. While I still maintain that the best way is to create a working copy at the Application level there are times and development process requirements when this isn't practical or possible.

Take this example: A team development with one Application split into many Projects. The Application is under source control using SVN. Their development process mandates commits are done per Project. There are a number of ways to achieve this, here are my suggestions for a team member to work on one or more projects and be selective about what is committed:

Alternate Take 1: Check-out each project as a separate working copy
  1. Create a new empty Application with no projects
  2. Use the SVN Navigator to select the root node of one of your projects in the repository
  3. Check this project out of the repository
  4. For the check-out destination, select the root folder of your newly created application
  5. You will get a warning on the Confirm Check Out dialog that you have selected a directory that is not empty - this is OK
  6. Continue to check out projects under your application root folder

  7. Now you can use JDeveloper's Commit Working Copy command on any node in a specific project and that project's changes will be committed.
Alternate Take 2: Filter the Outgoing Pending Changes Window

Using JDeveloper 11g you can filter the Pending Changes window by application or project. In the screen shot below I've filtered my outgoing changes to myProject1. I can select one or more of these files and with the context menu Commit Working Copy or Commit. I'd choose to select all the files and Commit if I had checked out my Application as the working copy. I'd choose Commit Working Copy if I had used Alternate Take1 to check out each project as a working copy. Unfortunately JDEV 10g doesn't have this filtering ability so this is an 11g only Alternate Take

I'm sure there are other Alternate Takes to both the level at which you version your code and how you manage checkin/out. I'd love to hear the good practices and the pitfalls.

Monday, January 14, 2008

I got tagged in the Oracle Blogsphere tag game by Shay Shmeltzer so here goes my entry of 8 things you didn't know about me.

1. In 1973 I was sent from Reading, UK to live on a cotton farm and attend high school in Arkansas, USA for a year by AFS Intercultural Scholarships. At the end of the year I was inducted as an Arkansas Traveler. Even now I drop into an Arkansas drawl the minute I reach the Delta - love it!

2. This started my love affair with Blues. It grew and developed after I met my husband, Scott, through his research for the original writers of songs recorded by such great guitarists as Rory Gallagher. In about 1986 during a blues festival holiday in Memphis (TN) we met some people who have become our great friends: David and Liz Berntson who, earlier in the year, had founded the Tulsa Blues Society. Also first met Paul Jones who was in Memphis to cover the festival for BBC Radio. As a result of these meetings we arrived home to find Paul had talked about our ideas on air and we started the British Blues Connection and the magazine Blueprint.

3. During over 10 years of the British Blues Connection and Blueprint, we became the first overseas Blues organization to be affiliated to the Blues Foundation and were Keeping The Blues Alive award winners in 1990. In the late 1990s we passed the UK blues gauntlet over to Blues In Britain

4. I love music, singing and dancing. From working the amateur chorus lines in productions like Lady Be Good in my 20s (when I was younger, thinner and more flexible!) to singing and dancing with blues men or my fab musical family or anyone who will let me. One of my special blues moments is dancing on stage with Willie Dixon when he presented us with our KBA Award in 1990. But it's not just about Blues, I love music - from Karaoke to Kraftwerk, Blues to Bartok and all the Kings (Elvis, Freddie, Albert, James, Frank, Bob ....)

5. I love to travel. I'm not sure I'll ever make the Traveler's Century Club (think I'm at about 35 currently) but I like to take every travel opportunity (whether work or leisure related!) Last year I added South Korea and China to my list and this year, as well as Europe and the USA, we will be in Rio to celebrate the wedding of our good friends: Blues man Alamo Leal and Mariza Lopez

6. My first personal computer was an Mac SE30 Bought this in 1989 when Blueprint became a magazine that could no longer be pasted and photocopied on my office copier but had to become more sophisticated as its readership grew. I learned how to use Adobe Pagemaker and spent many long, long nights waiting for the tiny screen to refresh as I moved across its 32 pages adding articles (Scott was the editor) and leaving space to paste in the photos. This was also the time of my introduction to 'programming'. I used spreadsheets and macros to maintain the subscription list and create mailing labels. At the time I thought I had designed a database!

7. Oracle is my second career. In my 20s I was a Financial Controller for a SME US company in the UK and started up subsidiaries in France and Germany for them. In my young, thrusting days I was even a finalist in the UK 'Young Career Woman of the Year' (can't remember which year - didn't get far). Later I took a Computer Science degree (for fun) and decided to try life at Oracle - the rest is history!

8. I have two favourite types of footwear! In the summer it's hard to imagine not being in flip-flops. I have many, many pairs - including High Havaianas that can make that awkward transition from shorts to cocktail dress ;-) In the winter I move into cowboy boots - the most comfortable footwear ever. But be sure to get a good brand. For me that has to be the Ariat.

So, if you see a flip-flop carrying, cowboy boot wearing, laptop hauling Oracle Product Manager demoing with blues-inspired examples - be sure to say "hi y'all"

I hate chain letters but who am I to deny you the opportunity to join the fun? So I tag Sue Harper, Kuassi Mensah, Doug Clarke, Eric Rajkovic, Brian Duff (sorry)

Monday, November 05, 2007

At what level should I version my source code?

This is a question that comes up regularly when I talk to development teams. And I believe that the answer should always be - at the top level.

If you are using JDeveloper this means at the application level. We adopt this in our own development here and it's my top tip for best practice. Some might want to argue that if their application is broken into a number of different projects then why not version those individually?

One problem with this approach could be cross- project dependencies in your application. Imagine that you work in one project on a day to day basic but there is a dependency on libraries held in another project (let's call it a 'library' project). You might checkout both projects at the beginning of the development cycle but assume that the 'library' project was complete and so you could just work and update your 'working' project. At some later stage, you could run into problems when you want to check in your 'working' project and realise that updates have been made to the 'library' project.

On a practical level, if you are using JDeveloper, you should not only follow my advice and version at the application level, but always ensure that your .jws configuration file is included in source control. This isn't a problem if you using JDeveloper's integrated SVN commands. When you select an application you automatically get the .jws file included.

But what if not all your development team are using JDeveloper? Perhaps you prefer to use Tortoise for your SVN interactions. Or perhaps you have some team members that use Eclipse or another IDE as well as JDeveloper? In this case it is important to ensure that you still place both your 'jws' and your 'jpr' files under source control.

Why? Because JDeveloper's SVN code looks at the state of those files to decide what menu options it makes available. For instance, say an initial import of an application to SVN had been done using Tortoise and the .jws file had not been included. I then check out this into a working copy in JDeveloper and make some changes. When I try to commit or update this working copy using JDeveloper I would expect to get the menu options 'Commit Working Copy' or 'Update Working Copy'. In fact, I would only see 'Import Files' as the .jws files would not be part of the versioned application and so JDeveloper offers you the option to place the application under version control.

I've come across this a few recently. The workaround is to go back to the repository and add the .jws file to version control. This brings the IDE back into kilter and allows you to continue using JDeveloper's integrated SVN support.

Wednesday, October 24, 2007

Connecting to CVS/SVN thru JDeveloper

Here is how simple it is to set up your CVS repository to work in JDeveloper 11g. The first step is to select your Versioning system. SVN and CVS are shipped with JDeveloper 11g. Other supported version control system can be downloaded via Check for Updates.
Now you can view the SVN or CVS Navigator from the View menu. Use the context menu of the parent node in the open navigator to create a new repository connection.
For CVS enter the details of your CVS repository in the wizard; including your access method and authentication style and user id (set by your CVS repository administrator). Test the connection and Finish the wizard. You are now able to browse the repository and Check Out a module using the context menu to begin work. To add a new application to the repository select Import Module from the Versioning menu.

For SVN enter the URL to the repository, user name and password, again Test the connection and click OK to complete the connection. As well as being able to browse the repository you can do other things such as create new remote directories from the context menu of the connection in the navigator.

To add a new application to the repository using either CVS or SVN, select Import Module from the Versioning menu.
By returning to the Versoning menu and selecting another version control system you can invoke the navigator for that system - without losing any of the connections you have to other systems.

Tuesday, October 23, 2007

SVN Branching in JDeveloper 11g

The latest Technology Preview of JDeveloper 11g is now available and contains some great new functionality to support Subversion 1.4.3.

We've added the Incoming Changes tab to the Pending Changes window - so valuable if you want a sneak preview of what changes others are making to files you have in Working Copies in JDeveloper.
Also, you can now filter Pending Changes at the application or project level.

But best of all, we've added support for Branch/Tag, Switch and Merge. I've created an online demo that you can play from OTN. If you haven't already, download the 11g preview and try it out - I'd love to have your feedback

Friday, June 22, 2007

Synchronizing with CVS in JDeveloper

Whatever your mechanism for working with CVS during development one of the things that we all like to avoid is unresolveable conflicts. But when working in a team environment it's an ever present evil.

Using the Incoming Changes tab of JDeveloper's Pending Changes window can help in pre-empting conflicts and managing them.

Here is a very simple example. I have an application under CVS source control that contains a number of classes. I'm working with a team who are also working on these files. In the Pending Changes window I can see that 2 of the files have been modified and checked in since I checked out my copy. This is shown in the Incoming Changes tab:

My local change is reflected in the Outgoing pane (I haven't bothered to insert an image of the outgoing pane here, but in this view I can quickly see that there is only outgoing change - and I know this is the only file I am working on). has been updated and checked-in by someone else but doesn't cause a conflict with my version. appears to have an unresolveable conflict. Double-clicking on the file in the Incoming Changes window returns me to the file in the code editor (or opens it), moves the focus to the History Tab, selects the Head revision to compare my local version of the file with and highlights the first change.

From here I have a number of options. Knowing that there is a conflict I could make changes to my code. Or perhaps I want to run Update and then use JDeveloper's Merge feature to resolve the conflict or perhaps I just carry on with my coding and choose to deal with the conflict at some later date, whilst keeping it in the back of my mind (and in my Incoming Changes window!) Whatever route I take, I'm able to keep my local copy and the repository synchronized and view/act on any conflicts as I choose.

I've kept my example very simple and have used JDeveloper In a future post I'll give you a taste of enhancements we've made to Pending Changes for the JDeveloper 11g

From Seoul to Shanghai with ODC

I can hardly believe it's been 8 months since I last posted here. In that time I've taken up a new role within the JDeveloper Produce Management Group and have been focused on different areas of the product than my previous SOA focus. I now work very closely with our development groups coming up with requirements for JDeveloper and support development.

This doesn't mean I don't get to meet with users any more, an important part of requirements gathering is to listen to what our customers are saying! This year I've been very lucky to have been involved with the Oracle Develop Conferences. I've 'done' Seoul and if you're in London next Tuesday and Wednesday be sure to get over to the Excel Centre for the London run of this conference designed specifically for developers. I'll be there talking web services, ADF and Fusion and would also love to talk to you about your complete application development lifecycle experiences - the what, why and how of your approach. I have a special interest in Source Control systems - so come and tell me how JDeveloper stacks up.

And Shanghai? Well that's where this year's ODC run closes at Oracle OpenWorld in Shanghai - and I'll be there too, maybe I'll see you?

Wednesday, October 18, 2006

No Time For Post-Vacation Blues

I'm back from the Delta and in San Francisco preparing and looking forward to Oracle OpenWorld next week and in particular the Oracle Develop event.

If you are in the San Francisco area during Oracle OpenWorld Oct 22-26, you have the opportunity to see Rod Johnson and Brian Behlendorf speak! Rod Johnson is one of the world's leading authorities on Java and J2EE development. Brian Behlendorf is the CTO and founder of CollabNet - the main sponsor of the Subversion project. He also cofounded and contributed heavily to the Apache Web Server Project.

And don't miss all the other great sessions and hands-on labs that my colleagues and I are presenting

See you there, come and say hello

Tuesday, October 03, 2006

Down in the Delta with the Blues

I wont be posting or answering comments for the next week as I'm down by the banks of the Mississippi for the Arkansas Blues and Heritage Festival. Anyone else going? See y'all there (must be said with an English accent tinged with Arkansas).
Otherwise, hope to see some of you at Oracle OpenWorld later in the month

Wednesday, September 20, 2006

Dealing with Complex Input Params in ADF Web Service Data Controls

A comment on a recent post prompts me to clarify how Web Service complex input parameters can be used in an ADF application

If the inputs are simple types or a single complex object (not an array of objects) then when you create the ADF Data Control for the service the data control palette gives you the structure of the parameters, enabling you to drag them on to a page as a parameter form or an action of some kind.

To illustrate consider the following method definition:

public Quote processOrderQuote(String productName, String itenType, String partnum, String quantity, String price)

Published as a web service, the complexTypes as seen in the WSDL file look like this:

The ADF Data Control created from the WSDL file uses OrderQuote elements as the String parameters. It wouldn't be my choice to name my parameters param0 - param4, not best practice, but that's the way this WSDL has been created. Dragging the OrderQuote service call onto a page will give you a choice of data bindings - perhaps you need a parameter form so that the input can be recorded directly, or perhaps just a command button or link where the input parameters will be existing data in your application

What about the more complex situation where the input parameter is an array of objects?

To illustrate consider the following method definition:

public Quote processPOItemsQuote(Item[] items)

Published as a web service, the complexTypes in the WSDL file look like this:

And the Data Control looks like this:

In this case the input parameter - the array of objects - is not dealt with directly by the data control. I'm working with JSF so I need to use a managed bean to populate the input parameter, the principle is the same in other UIs too. In my scenario, I need a parameter form for a user to enter the itemId and quantity of the item they want to get a quote on. To keep my example simple, just one item is going to be quoted on - but an array is still needed to fulfill the service's input requirement.

1. I've created a JSF JSP page (getPOQuote.jsp) with a backing bean ( First I want to add my input paramaters to the bean. I've added 2 new variables to the and using JDeveloper I can automatically generate the accessors:

2. Next I need to create a method to populate the array that my service is expecting as a parameter. I added the getItems method:

3. I add two ADF Faces Core: InputText components onto my page and use the Property Inspector(PI) to give them the labels I want

4. Now I want to bind the value of these input fields to my new backing bean attributes. I select the Quantity field and in the PI Value property type #{ and hit enter. This tells the framework that I want to use the Expression Builder(EB) and I can open the EB by clicking the ellipses button.

5. Now I can browse to my backing_getPOQuote managed bean and double-click the quantity attribute to create the expression #{backing_getPOQuote.quantity}. This ensures that the user input to the quantity field is bound to the quantity attribute of the managed bean. I need to repeat this for the Item Id field and bind that to itemId

6. Finally, back in my page I can drag the POItemsQuote(Object) service from the DC palette onto the page as a ADF Command Button. In the Action Binding Editor I can use the ellipses to the right of the Value column to browse to the items attribute of my managed bean (remember in Step2 I created the getItems method in my managed bean) to pass the input object to the service

7. Back in my page, if I open the Page Definition File I can see that the POItemQuote methodAction is now correctly populated with backing_getPOQuote.items being passed in as param0

And that's it, add a page to show the result of the service, add a navigation case to it and run!

Friday, September 15, 2006

SOA and the Database - Heresy?

It comes up a lot at conferences and seminars: Where should my business logic reside - the database or the middle-tier? In the SOA world you might think that using the database was the wrong choice, but why not leverage your existing DB-level validation from your Business Services?

I recently had some correspondence with Kent Graziano of ODTUG fame on just this topic. He says, "essentially we generate the TAPI and the associated DB triggers on all tables. The developers then write simple insert, update, and delete SQL against the tables to pass the required data elements. The triggers fire the TAPI procedures and fill in the auto generated stuff (sequence ids, date created, user created, etc). And voila you get referential integrity without coding in the middle tier. One of our apps is even generating the journal records automatically for audit trail. In addition all these applications rely on Oracle views or materialized views (from our read-only ODS) as the source for all the drop down lists. Seems that may be an SOA-type approach as well since we have abstracted the data one layer above the actual database tables (and we reuse the same view definitions for multiple applications to insure one-source of truth across the apps)."

I don't see anything wrong with this approach. Of course, from an SOA point of view you must ensure that your services are just that, and not too fine-grained, but that can be dealt with in or above the DB level in whatever technology or framework you choose to develop business services in.

Moving forward, it might be that Kent's application developers will take advantage of the benefits of middle-tier business logic and rules - for instance using the ESB and Rules Engine of Oracle's SOA Suite - but that's another discussion! So, am I an SOA-heretic to use database logic and services in the same sentence?

Thursday, June 22, 2006

Developing J2EE1.3 and 1.4 Web Services in tandem

Alan Gibson, one of our engineering gurus here in JDeveloperland, gave me this tip recently for developing both J2EE 1.3 and 1.4 services in the same application.

1. Add your base Java implementation to project1
2. Create project2 for your J2EE1.3 Web service
3. In the Dependencies tab of the Project Settings for project2, check project1 as a dependency
4. Publish your J2EE1.3 service in this project
5. Repeat steps 2-4 for a J2EE1.4 service

There is a bug in the J2EE1.3 service creation that means the node for the web service will show up in project1, but the crucial thing is that the J2EE1.3 web.xml file will go into project2, so this solution does work properly when you deploy or run it.

This is a good example of the way you can use project dependencies to separate your base logic from the service artifacts - even if you only have one kind of service implementation.

Friday, June 09, 2006

Watch a demo using BPEL in an ADF application

I've just published a demo on OTN that runs through integrating a BPEL process in an Oracle ADF application. It's so easy, so 4GL! Check it out and let me know what you think.

Tuesday, June 06, 2006

<any> Element can be mapped in a Web Service

Recently I was reading ecco's blog on Web Services and XML Documents and although he is correct saying don't use org.w3c.dom.Element in your method signature I realised that I'm often asked how to deal with just this scenario. What happens is that the infamous <any> is generated into your WSDL types and you need to be able to map that to the correct XSD. But help is at hand if you are using JDeveloper. Here are the simple steps to map Element to your XSD of choice - and you can do this pre or post generation using the Web Services Editor.

Take a really simple class as an example:

An extract of the WSDL generated for this class looks like:

But if you have the XSD that actually corresponds to your Element (and changing the Java method signature is not an option):

Then you can use the Web Services Editor to add a custom mapping between Element and blahType

You'll need a dummy serializer (even though Element is already serializable), here is a simple example:

And that's it, now your generated WSDL looks like this:

No ugly <any> in sight!