الثلاثاء، 7 أبريل 2020

OAF Best Practices



Usage of having highly used methods in AM is better then having in controller When we write some business logic which is widely used in the application,it should be written as a method in application module. If the same method is written in different controllers, they get compiled more then once i the same transaction. In application modile, the method gets compiled only once, which can be used from different controllers in the same transaction.
While inserting data in tables, its better to be done through EOs rather then PLSQL APIs Interaction between JVM and PL/SQL engine is time consuming. If the requirement is to insert/update some record in database table, doing it using entity object is a faster appraoch.
Invoking PL/SQL methods should be done only when necessary as the JVM and PLSQL engine interaction consumes considerable memory As discussed earlier about database interaction performance issue, its better to invoke PL/SQL methods only when its necessary.
During controller extentions, we should use super.process() methods rather rewriting the original methods in the custom controller Because, if the original methods get affected in a new patch or upgrade, it will hamper the application. If we use super.processRequest and super.processFormRequest, no matter the custom logic in the custom code, the standard methods will always be invoked.
Adding VOs to the AM in the design time is better then doing it programatically When VOs are added programmatically, they get compiled every time the program code gets compiled and executed. When they are added in the designed time, its a one time activity.
Database related business logic should be written in EO By placing business logic in entity objects(validation, etc..), the logic can be reused for different view rows in view instances. It provides the highest degree of reuse(compared to writing the logic in VO or AM).
Session values should be removed when they are not required Session parameters should be removed once they are used, else they could create inconvenience in the rest of the flow where the same parameter name is used to store some session value. Also, Session, transient and transaction parameters must be removed as they consume memory undesirably effecting the performance.
Clear Cache For Dynamic message choice(dropdown), we must write setPickListCacheEnabled(false) to clear the cache, otherwise the list of values in the dropdown will not change when the corresponding query is executed again.
Usage of Bind Variables in VO object is better then appending where clause. Bind parameters and where clauses should be set to null every time the VO is executed.

ليست هناك تعليقات:

إرسال تعليق

ADF: Programmatic View Object Using Ref Cursor.

ADF: Programmatic View Object Using Ref Cursor. Posted by:  Manish Pandey   April 25, 2013   in  ADF   Leave a comment   3758 Views Sometime...