The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.

Tuesday, July 17, 2012

ADF Anti Patterns

I was looking into some of the anti patterns followed by developers while build applications for the enterprise World. I came across one of the useful doc in this direction by ADF-EMG group at https://sites.google.com/site/oracleemg/adf/files

I would still like to summarize the covered anti-patterns here for a quick review:

1. Do not use Composite Primary Keys. Better to use sequences as single attribute primary keys.
2. Do not set Read Permissions on Entity Object. Better to prevent the view access to such pages.
3. Do not mark associations as Composite better to handle it by marking foreign key as not null.
4. Do no call Application Module from inside Entity Object code.
5. Do not call Application Module from inside View Object code that can be found using View Accessors.
6. Do not call setter method of an attribute from the getter method of another attribute.
7. Do not use FacesContext or any other View Layer code in the model layer.

Some, of these might sound quite obvious but developers do ignore these quite often. Most of these anti-patterns usually hints for avoiding either due to performance reasons or due to breaking the standard Object Oriented design principles one of those guides as "Do not invoke anything from the outer layer in any of the inner layers". Another supporting theory is called as 'Onion Architecture'
Post a Comment