Saturday, 7 May 2016

Understanding Siebel Open UI OOPS

Siebel Proxy Objects, PM and PR

Siebel SRF has all the information about the UI objects like current view, applets, applet controls, toolbars, menus etc. In Siebel Open UI framework, a mirror of these UI objects are created as JavaScript objects using JS files. Siebel has built these objects to store object data and behavior.
Everytime a view loads, the vanilla scripts run a command to create current view object and create child applet objects etc.

Let us take this analogy. Consider we are building a shooting video game. We want to build a game where some shooters are shown in UI, they do actions like shoot, run etc., each shooter has life points, bullets count etc. In object oriented approach, we create an object called shooter. This would be our prototype. Whenever we need a shooter, we create a new shooter like this
Shooter test = new Shooter();
We assign some logic to our scripts so that the objects behave in certain order and remember some data.

Similar to this, Siebel Open UI framework is object oriented. We have scripts like applet.js, view.js, appletcontrol.js etc. These files are our prototypes. Along with our objects, we have a Presentation Model and Physical Renderer files like viewpm.js, viewpr.js, pmodel.js, phyrenderer.js etc. Presentation model is the brain of the object. It stores the objects data and logical actions. Physical render is the body. How the object should look in UI and what action in UI should trigger which logical action in PM. PM and PR are linked.

For an applet, PM knows what controls are available in an applet. PM sends this information to PR. PR is the file that draws the controls in UI. If a user clicks on a button, PR listens to the click event and it invokes a logical event in PM. For example, it communicates a physical click on button to PM to make a logical event like NewRecord.

Now, we understand that each object has PM and PR. If we want to extend or override a functionality or behavior, we need to extend the vanilla PM/PR files and build our logic.


We use OOPS concepts like Inheritance (we write a custom PM/PR that inherits vanilla PM/PR thus acquiring all the Properties and functions), Polymorphism (we have the same method in different applets but each behave differently, we override behavior), encapsulation (capsulate the data and code together in one unit, we have one PM object that has Properties and Methods)

2 comments:

  1. A belated thank you for these posts. They are very helpful.

    ReplyDelete
  2. This post is very simple to read and appreciate without leaving any details out. Great work !call center solution provider

    ReplyDelete