My team needs to create a set of abstract classes in Constellation.
There’s an excellent article on this: Abstract classes in Constellation not a best practice
My team wants to use a pattern in which abstract classes are required: This is the Facade pattern from the famous Design Patterns book.
Solution without Facade
Here is how our solution looks without a Facade:
Physical data model: Consists of concrete data objects with records in the DB.
Case layer: represents user journey. The case is straightforward but very data-driven – there are subflows, and subflows-within-subflows, that iterate as many times as there are data instances.
The challenge is that the physical data model is determined by today’s business requireme nts – for MLP1.
However, there are other MLPs coming later which involve major changes to the data model – not just adding objects and relationships but changing relationships from 1:M to M:M, and even wholesale replacement of some objects with new objects. We don’t have sight of all the future requirements – and even if we did, designing our data model around requirements that may or may not happen next year is not agile.
Therefore, think of today’s physical data model as an ‘implementation’.
When these big changes happen the case will have to be re-engineered to accommodate them, because it is tightly coupled to the implementation, which will be a big development.
Solution with Facade
Here is how our solution would look with a Facade:
Facade layer: This represents the abstract and unchanging aspects of the data model that the case needs to interact with. Modelled as a set of abstract classes with data pages to form the interface that the case uses. Data pages invoke data transforms that reach into the physical layer and transform the data into instances of abstract classes which are returned to the case: There are no DB records for these abstract classes – they are created on the fly. Hence we need abstract classes for this.
Some of the physical layer data objects don’t even need to be known about by the case, though they do change the way that other objects are returned to the case - hence the facade layer can hide these objects from the case and perform the transformations that use them.
The facade layer decouples the case from the current implementation (the physical data layer). When future change happens in the physical layer (i.e. the implementation changes) our changes are localised to the Facade layer. We don’ t need to re-engineer the case.
(Think about the way that Pega Connectors work – where they map Application layer data to Int layer data on the outgoing call, and map Int layer data to Application layer data on the incoming response – it’s a similar principle – those classes don’t have to be concrete – very often they are abstract because the data is not saved to the database)
Our challenge
As far as I am aware App Studio does not easily support abstract classes, therefore we will have to create them as concrete and switch to Dev Studio to change them to abstract. I am concerned that our case (created in App Studio) might not find it easy to plug into the facade layer.
Does anyone have experience of using App Studio and Constellation to create abstract classes? What challenges did you face? Any thoughts or tips?



