How to extend a sap.ui.base.Object

The sap.ui.base.Object is the base class for all SAPUI5 objects.
This class can be used, for example, to organize coding from the view controller and encapsulate it. This way you can create reusable classes for other SAPUI5 apps.

Template

sap.ui.define([
	"sap/ui/base/Object"
], function(UI5Object) {
	"use strict";
	return UI5Object.extend("<PROJECT_PATH>.control.<NAME>", {

		/**
		 * @class <NAME>
		 * @summary <SUMMARY>
		 * @extends sap.ui.base.Object
		 */
		constructor: function() {
			UI5Object.apply(this);

		},
		/**
		 * @memberOf <NAME>
		 * @description getXYZ
		 * @public
		 */
		getXYZ: function() {
			//do sth.
		}
	});
});

Leave a Reply

Your email address will not be published. Required fields are marked *