Purpose of Application Element in Openbravo

Hi All,

Application Element is one really cool feature in Openbravo, that I managed to get hold of after a while. I just wanted to share the importance and the influence of the application elements as it will cause lots of maintenance problems if not handled properly.

Application Element is mainly used for Re-Usability. It will actually reduce lots of our development time when handled properly. Whenever we create a new column, the synchronize terminology process will create a new application element(if it doesn’t have any element for the same column name). Thereafter whenever we create a new column with the same dbname, it will map the same application element for that column. Because of this mapping, we can manage the display name,help/comment, description globally. That is we need not go to each and every column and change the display name,help comment or description. It will be mapped globally to all columns that uses a particular column name. Web Service is one of the most important thing in openbravo. This web service will use the name which we provide as column name in column table.

A good example could be, think of the column ad_client_id. We should use that field in all tables. Just think what will happen if we need to give the display name, help/comment and description manually for all the tables. Its not just tables, but windows too. As of now, we are not doing that because, we have the application element that is created already for the ad_client_id column that does all these things.All these are possible only when the required application element is in your module or in any module that your module depends on. This can be set in the dependency tab of the module window.

I have attached a screen shot where AD_Client column’s name is updated to ‘Client’ and description and help comment are added by itself. I have also attached the Application Element from which these comments are taken from.



Handling Application Element Properly:

1. Always use the common notation for column names that represents same meaning.
ie., Always remember to check whether we have any column that already have the same name. If exists, use the already existing one.
Eg: If the requirement is to create a field to store begin date, we can give the column name as begin_date, bgn_dt,begin_dt,etc.,  But we already have the column used in many places as begin_date. So use that.

2. Always use the meaningful notation for representing column names.
Eg: Though most people can understand begin_date,begin_dt,bgn_dt,bgn_date represents begin date, begin_date makes more sense.

3. Consider, you added a new column that is not present in the system.
Eg: previous_month
For this column, when you give synchronize terminology, the application element will be created as, Previous_Month. It will be displayed in the application element field in the columns as Previous_Month-Previous_Month.
1. Go to Application Dictionary -> Setup -> Element.
2. Search Previous_Month
3. Rename the Name field to Previous Month.
5. Give the description and Help/Comment
4. Rename the Name field to Previous Month in the column window also.

As you can see, you only need to rename the “name” field in column table. The help comment/Description would have been populated automatically. Thereafter the same name will be used when ever the same column name is used.

In Openbravo, if we have a wrong application element, no DAL related process, procedures, callouts, etc(EVERYTHING since openbravo is completely implementing DAL), will work. From a developer’s point of view, none of the efforts in writing any code is going to work with improper application element. I just wanted to stress out the need for better care towards it.

Advertisements

About Pandeeswari Ramakrishnan
Applications Engineer, Openbravo

One Response to Purpose of Application Element in Openbravo

  1. Admiring the persistence you put into your site and in depth information you provide. It’s good to come across a blog every once in a while that isn’t the same outdated rehashed information. Wonderful read! I’ve bookmarked your site and I’m including your RSS feeds to my Google account.
    My website is Low carb diet plan.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: