Fastman
  • Innovation
    • Into the World of Cloud
  • Products
    • Fastman for SAP®
      • Fastman Permissions Management Suite for SAP® Extended ECM​
      • Fastman Data Transformation Hub for SAP® Extended ECM
      • Fastman Digital Signature Connector for SAP® Extended ECM
    • Fastman for OpenText
      • Access Manager
      • Permissions Manager for OpenText Content Suite
      • Permissions Manager for Outlook
      • Bulk Data Manager
      • Bridge Connector
      • Digital Signatures
      • Extract Tool
  • Services
    • EIM Consulting
    • Content Suite Health Checks
    • Content Suite Migrations and Upgrades
    • Enhanced Managed Support
  • Resources
    • Fastman Test Drive
  • About
    • Events
    • Clients
    • Partners
  • Blog
  • Support
  • Contact
  • Search
  • Menu Menu

Design Patterns in Smart UI

One of the reasons why Smart UI fascinates me is the way Design Patterns are used.  As you explore Smart UI code you encounter many of these patterns.  But what is a design pattern and why use them?

There are many definitions and variations of Christopher Alexander’s original definition, but the one that I liked is the following:

“A Pattern is a named description of a problem and solution that can be applied to new contexts; ideally, it provides advice in how to apply it in varying circumstances, and considers the forces and trade-offs. Many patterns provide guidance for how responsibilities should be assigned to objects, given a specific category of problem.”

In simpler terms, a pattern is a reusable solution that can be applied to commonly occurring problems without the need to code a completely unique solutions each and every time.  Design patterns are templates which, when applied, solve commonly occurring design problems through proven solutions.

MVC (Model-View-Controller):  Out of the many design patterns observed in Smart UI, MVC is the most important one. Without an understanding of MVC, if you start designing/coding in Smart UI then you are really asking for trouble. MVC addresses separation of concerns and decouples the business/domain data (Models), the presentation layer (Views), and the interactions (Controllers) between various parties (User Input, Model Changes/Updates, View Changes/Updates).

But why is this decoupling required and how does it help? Decoupling reduces spaghetti code. By doing so, it reduces dependencies; allowing separate development of user interface, business data objects, and the data flow handling. More importantly it helps code re-use. While the Model represents the data in an application, a View is the visual representation of the Model.  Finally, a Controller manages the communications between the UI and the data, updating the views when data (Model) changes and updating the data when the information within a View is changed though some user input/interaction.

A second variation of the MVC pattern also exists. Called MVP (Model-View-Presenter), it further decouples the Presentation logic from views and this acts as a Controller.

Smart UI neither applies pure MVC nor a MVP design pattern. There are no controllers in Smart UI (though context is a Marionette Controller, it is not the MVC’s controller). There are no Presenters either. All the business data in Smart UI is represented by Backbone Models and the presentation layer is implemented through Marionette Views. The Views in Smart UI play the role of MVC’s Views and also the role of the Presenter under the MVP paradigm.

Command:The menu actions in Smart UI are implemented through a Command design pattern. The main idea behind the command pattern is that it provides you a means to separate the responsibility of issuing commands from that of executing them, delegating this responsibility to different objects instead. To achieve this separation, the designer creates an abstract base class that maps a receiver (an object) with an action (a pointer to a member function). The base class contains an execute() method that simply calls the action on the receiver. The core implementation of Copy /Move/Reserve/Initiate Workflow, etc are all carried out through Command design pattern. Copy/Move/Reserve Actions are actually all concrete Command implementations. So the function menus in the Classic UI, are now encapsulated as Commands.

Mediator: The heart of all the Smart UI components (from my perception) is a Context object. If we dig more into the definition of this module, anyone would surely get the shock of their life. The declaration says it is Marionette Controller. However, if you view to the latest Marionette library code or the documentation, you will not find any information relating to this controller – it has been deprecated. With all your new-found MVC knowledge, the inference would be that it could represent a Controller. But it actually has nothing to do with MVC and is indeed an application of the Mediator pattern. The Mediator pattern defines an object that encapsulates how a set of objects interact. Mediators promote loose coupling by keeping objects from referring to each other explicitly and letting you vary their interaction independently.

Factory: Creates objects without exposing the instantiation logic to the client and refers to the newly created object through a common interface. Most of the models and collections in smart UI are created through Factories.

Observer : Defines a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically. For example, the breadcrumb panel is an observer and gets updated as the current folder/container changes. Similarly the filter panel is the subject and whenever a filter is changed the browse widget observes it and shows filtered data in response.

Decorator: This pattern adds responsibilities to individual objects dynamically and transparently, that is, without affecting other objects. For Example the perfect scrolling or infinite scrolling behavior can be added to a view or widget without actually writing the code in the View definition. This helps code re-use and decorates the view with the behavior.

There are more design patterns observed in Smart UI but the intention of this article was never to actually list everything or write in depth details, about the design patterns. It is about sharing part of my journey and inspiring others. If there are other things that you would like me to write about my Smart UI SDK development, reach out to me directly or add a comment to this post.

About the Author

Siva Salipalli is a Solution Architect and OScript Developer with Fastman. He is experienced in Web Reports, Builder, CSIDE  for Livelink 9.2 to Content Suite 16.2 and  OpenText Smart UI SDK for Content Server 16 and Content Suite 16.2. He has worked on solutions such as Fastman Permissions Manager & other custom modules for partners and customers.

Share this post!

  • Share on Facebook
  • Share on Twitter
  • Share on WhatsApp
  • Share on LinkedIn
  • Share by Mail

More from our ECM Blog

New Fastman Digital Signature and Permission Manager releases

Announcements, Digital Signatures, Digital Transformation, Permissions Manager
https://fastman.com/wp-content/uploads/2021/02/M-Y-E-S-C-A-P-E-e1613395566433.png 429 432 fastman01 https://www.fastman.com/wp-content/uploads/2017/06/fastman-logo.png fastman012021-02-15 13:35:112021-02-15 13:37:09New Fastman Digital Signature and Permission Manager releases

5 Reasons to use digital signatures for Extended ECM for SAP® SuccessFactors / SAP S/4HANA

SAP for Extended ECM
https://fastman.com/wp-content/uploads/2021/02/Digital-Signature-Connector-for-SAP-blog.png 429 1030 fastman01 https://www.fastman.com/wp-content/uploads/2017/06/fastman-logo.png fastman012021-02-04 08:51:442021-02-18 08:52:535 Reasons to use digital signatures for Extended ECM for SAP® SuccessFactors / SAP S/4HANA

5 Tips for Efficient Record Management with SAP Extended ECM

Data Transformation Hub for SAP Extended ECM, Digital Transformation, SAP for Extended ECM
https://fastman.com/wp-content/uploads/2021/01/Untitled-design-24.png 429 1030 fastman01 https://www.fastman.com/wp-content/uploads/2017/06/fastman-logo.png fastman012021-01-25 09:00:372021-02-16 13:06:365 Tips for Efficient Record Management with SAP Extended ECM

How to Protect Your Information from Unauthorised Access on SAP Extended ECM

Digital Transformation, Enterprise Content Management, Information Security, Permissions Manager
https://fastman.com/wp-content/uploads/2021/01/Untitled-design-22-1-e1610523090989.png 208 500 fastman01 https://www.fastman.com/wp-content/uploads/2017/06/fastman-logo.png fastman012021-01-12 10:14:302021-01-25 14:13:12How to Protect Your Information from Unauthorised Access on SAP Extended ECM

About FastMan

By tuning the core platform and aligning it with individual business needs, Fastman improves user adoption and radically changes the way organizations use OpenText™ Content Suite and SAP® Extended ECM.

Products & Solutions

Fastman for SAP® Extended ECM
Fastman for OpenText

Services

EIM Consulting
Content Suite Health Checks
Content Suite Migrations and Upgrades
Enhanced Managed Support

Contact

Email:
Fastman Support
Online Contact Form
Copyright © 2020 Fastman Pty Ltd. All rights reserved.  Disclaimer | Privacy Policy - powered by Enfold WordPress Theme
  • LinkedIn
Trade Management in the Digital Economy OpenText Smart UI – OScript Developer’s Perspective
Scroll to top

This site uses cookies. By continuing to browse the site, you are agreeing to our use of cookies.

Accept settingsHide notification onlySettings

Cookie and Privacy Settings



How we use cookies

We may request cookies to be set on your device. We use cookies to let us know when you visit our websites, how you interact with us, to enrich your user experience, and to customize your relationship with our website.

Click on the different category headings to find out more. You can also change some of your preferences. Note that blocking some types of cookies may impact your experience on our websites and the services we are able to offer.

Essential Website Cookies

These cookies are strictly necessary to provide you with services available through our website and to use some of its features.

Because these cookies are strictly necessary to deliver the website, refuseing them will have impact how our site functions. You always can block or delete cookies by changing your browser settings and force blocking all cookies on this website. But this will always prompt you to accept/refuse cookies when revisiting our site.

We fully respect if you want to refuse cookies but to avoid asking you again and again kindly allow us to store a cookie for that. You are free to opt out any time or opt in for other cookies to get a better experience. If you refuse cookies we will remove all set cookies in our domain.

We provide you with a list of stored cookies on your computer in our domain so you can check what we stored. Due to security reasons we are not able to show or modify cookies from other domains. You can check these in your browser security settings.

Google Analytics Cookies

These cookies collect information that is used either in aggregate form to help us understand how our website is being used or how effective our marketing campaigns are, or to help us customize our website and application for you in order to enhance your experience.

If you do not want that we track your visit to our site you can disable tracking in your browser here:

Other external services

We also use different external services like Google Webfonts, Google Maps, and external Video providers. Since these providers may collect personal data like your IP address we allow you to block them here. Please be aware that this might heavily reduce the functionality and appearance of our site. Changes will take effect once you reload the page.

Google Webfont Settings:

Google Map Settings:

Google reCaptcha Settings:

Vimeo and Youtube video embeds:

Other cookies

The following cookies are also needed - You can choose if you want to allow them:

Accept settingsHide notification only