on 12-17-2013 9:27 AM
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?
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.
Tobias
After searching a lot I am using the ManagedObject. However, there are some issues when using ManagedObject.
For controls, use Control.extend, and for everything else, most people will use Object.extend.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
did you manage to use an Java-like paradigma?
in example:
TestObjectClass = function(){ };
TestObjectClass.protottype = sap.ui.base.Object.extend("TestObjectClass", {
constructor: function() {
alert("TestObjectClass-Const");
}
});
TestObjectClass.prototype.doIt = function(){
alert("DoIT");
};
TestObjectClassNeu = function (){ };
TestObjectClassNeu.prototype = TestObjectClass.extend("TestObjectClassNeu", {
constructor : function(){
alert("TestObjectClassNeu-COnst");
},
doIt : function(){
alert("DoIT-Now!");
}
});
When you want to try use:
var oInstance = new TestObjectClassNeu();
oInstance.doIt();
If i want to use something like this in the function doIt, but it won't work:
TestObjectClassNeu.prototype.doIt = function(){
super();
alert("DoIt-Now");
};
Did you find a solution for that?
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.