Wednesday, 10 September 2008

JDev 11g ADF BC – New feature "Property Sets"

"Property Sets" are a new addition to ADF Business Components (ADF BC) in JDeveloper 11g. Property Sets are related to the extensible Custom Properties framework definable on EO & VO attributes, as well as at the EO, VO and & AM levels. If you're not familiar with the power and usage of ADF Business Component extensible Custom Properties look at my previous post I rest my case: Converting ADF BC EO/VO attributes to upper and lower case with custom properties or Avrom Roy-Faderman's post The Power of Properties.

Property Sets allow us to define a set of Custom Properties, essentially key value pairs, and then apply them to the ADF BC objects, without having to manually create each key value pair manually ourselves.

If we take a rather simplistic example, we could define a new Property Set "Alpha", with 2 properties "Beta" and "Charlie" as follows:

Then for example, we can select an attribute out of an EO or VO, and change the Property Set value to our new Property Set:

To prove the Custom Properties apply at runtime, without coding, within the Business Components Browser, we can right click on the attribute in question, and you can see a small information box that shows the runtime properties of the field, including the Property Set key value pairs we created.

This is obviously just a small new feature within JDeveloper 11g, but yet again a declarative productivity booster to stop the programmer having to waste time inputing values.


horzsolt said...

Great post, but can you describe more detailed why the usage of the Property-Set is useful (practical example). Thanks!

Chris Muir said...

Assuming you understand the power of custom properties, imagine you had to apply a set of custom properties, say 4 custom properties, to 30 EO attributes in your application for example. That means you need to create 30 x 4 = 120 custom properties. With the advantage of Property Sets, you'll only need to do it 30 times. In turn if you count the fact you will easily make a mistake in the 120 custom properties settings in the former example, but with Property Sets the chance of a mistake is nearly eliminated because you just assign a Property Set, no typing on your part as such, this makes Property Sets very appealing. All an extreme example of course.

Again the assumption is you understand what custom properties are and why as a declarative feature of ADF BC they are so powerful. If you don't appreciate this, read the 2 links in the original article.