Tuesday, August 28, 2012

To Extend or Not To Extend Base Classes?

This is one of many follow-up to my previous post: Planning an Enterprise Scale ADF Implementation?

Should you extend your base classes in your BC Model project? It's up to you if you think you'll need to. Do you think you'll need to change a built-in feature to behave differently or to add a new feature? Do they need to be used by all of your applications? To do so requires that you do it prior to generating any business components in your project. The most common components extended are:
  • Entity Definition
  • View Object
  • View Row
  • Application Module
  • Database Transaction Factory
  • Database Transaction
By extending these classes you can override logging methods to provide your own unique logging to your applications. Or you can override transactional methods like the doDML() methods handling the transactional commit operation.
 If you think you will use shared business components then you need to use generic extended interfaces. I would go ahead and set these up and get use to using the extended classes. It will give you a way to provide a common interface to all your business components. Any exposed custom method in any of your generic extended base classes can be used in any other business component class in the application.

So there are a lot of benefits to using extended base classes. It's just up to you and your development team to use it the right way.

No comments:

Post a Comment