Skip to Content
Former Member
Dec 17, 2013 at 09:27 AM

Interfaces, Classes and Base Classes, HowTo OOP


Hi there

I want to do some interface implementation and afterwards creating some classes extending the interfaces.

I took a look at the custom controls developer guide, but this guide is for UI controls only. I want to do some kind of database abstraction layer, with some interface methods and some implementing classes.

What is the right way to do this?

  1. Define some interfaces, extending the interfaces by using sap.ui.base.Object.extend?
  2. Don't use interfaces at all. Simply use sap.ui.base.Object.extend?
  3. Don't use Object as a base class, but use sap.ui.base.ManagedObject.extend instead?

The main goal of these abstract classes is to provide some methods and maybe some sample implementation (or some kind of comments, if not possible at all). Later these methods will get implemented by another classes using these interfaces.

The developer guide doesn't get that much hints on how to use object oriented programming using SAPUI5.

Currently I'm on SAPUI5 1.16.3 using NetWeaver AS Java.