OutSystemsDev Zone

Refactoring Large Complex Systems with 5.0

Francisco Menezes, responsible for the Application IT at OutSystems, started by mentioning that OutSystems web applications are all built with the Agile Platform. Over the years, this set of applications got rather large, and refactoring become a challenge.

Francisco pointed out that applications should be designed to scale and potentiate reuse, but due to fast business changes and team rotation, applications grow endemically, which is an impediment to have a one shot “perfect” architecture. 
Francisco said that he sometimes faces changes from business that demand releases every 2 days, which leads to applications not growing in the most orderly fashion. Another thing that hinders the perfect architecture is the fact that sometimes you need to adapt existing components to fit the existing infrastructure.
At this time Francisco revealed that, from his experience, the 5.0 version of the platform refactors 10x faster than 4.2!!! Actually, refactoring turned out to be so easy, his team ended up doing more than initially planned!
Francisco gave a few common scenarios where refactoring is used:
  • Separate business logic from UI
  • Isolate services for reuse (bottom-up SOA)
  • Isolate integrations with 3rd parties
  • Replace or adopt a component
refactor.jpg

 

Francisco them moved on to explain the recommend architecture for OutSystems’ internal applications. This is a layered architecture, with the following components:

  • Website orchestration
  • Business processes
  • Core business services
  • Infrastructure services
The recommendation is for top layers to consume whatever the layers below make available, but never the other way around. Unfortunately, applications are not always built with this layered model from day one. Sometimes it is simply impossible to know beforehand how the application is going to grow, which makes refactoring even more of a priority.
Francisco moved on to show the tools improved in the Agile Platform 5.0, to make refactoring as easy as possible. These include:
  • Realtime TrueChange
  • Copy & Paste improvements
  • Enhanced Find & Replace usage
  • Improved Compare & Merge
  • New Reference capabilities

With these tools, developers can follow the 4 steps to refactoring. For each of the steps, Francisco highlighted the gains he had in productivity just by using 5.0:

  • Isolate and clean the objects to be moved – 2x faster
  • Extract the objects into a new eSpace – 5x faster
  • Generalize the protocol of your new Service – 2x faster
  • Remake references on the consumers – 20x faster
Francisco confided that, although he’s talking about 20x faster on that last scenario, he believes sometimes it goes up to 100x faster! The new capabilities of 5.0 are really helpful on this scenario!
To prepare the room for the demo, Francisco gave a short explanation of what he was going to show. In a nutshell, the goal is to move Accounts, a part of a component used by several applications, to a stand-alone component.
In Service Studio, Francisco took advantage of the new features of 5.0 to isolate, extract, and finally remake all the references to Account! Even with the extra time Francisco took to explain the process, the whole refactoring was done in about 10 minutes!
At one point of the process, TrueChange was showing about 500 errors in the application. Using the new capabilities in 5.0, Francisco healed these 500 errors with a single click! That really impressed the audience!

 

About the author

Rodrigo Coutinho

A member of the founder’s team, Rodrigo has a passion for web development, great products, and geeky stuff. He spends his time designing future versions of the OutSystems Platform and dreaming about the cool future of the web.

Leave Your Comment