I decided! I’m planning a reboot!
I’m almost done building version 4.0 of the software factory (SF). Right now, the only missing portion is updating all the model editors to work with the new model service format. But I am reluctant to put a lot of effort into supporting my old legacy model types in the new system.
Decoupling = Freedom
A vital feature of the new version was to decouple model types from the SF engine. This allows “easily” to create, add, and manage new model types.
Before v.4.0, models were tightly coupled directly into the SF generation engine. Up until v4.0, the SF was still carrying a lot of legacy code that dates back to when the SF was started. A lot of this code was from well over 10 years ago was had evolved from a system design with a different mindset, architecture, and when the actual structure of the SF was a lot less obvious to me.
With the decoupling of the models from the engine, adding new model types to the SF should, comparatively, be a breeze.
What’s wrong with the current models?
The existing models I currently use are pretty helpful for the most part. But they also are dated and quite monolithic.
Everything is in a single massive model, and it cannot be broken apart. For example, The component model that I use to generate services contains:
- data structures;
- business rules;
- access control;
- and API interfaces.
This model type is also quite limiting; for example, data types are defined as an enum. Adding support for new data types is complicated because it requires a complete rebuild of the model type. This has the potential to affect ALL the models based on this type.
In addition, because of the difficulty in creating and updating model types, I, as the bad person I am, came up with some hacks in the models to store extra data in places that were not designed to do this…
How to make better models?
Instead, the goal would be to create a more modular system that contains multiple model types that can reference each other.
I’ve wanted to support a modeling system based on DDD for a long time. I find things like value objects, domain entities, bounded context, and aggregates are concepts that could make for beneficial and descriptive models. And to be the kind of modeling, I would like to work with.
Imagine that you can define a domain entity’s field types by selecting from an existing list of value objects. Or that you can just drag n drop domain entities into a service. Or that you can add multiple entities to an aggregate and select which fields to use as part of the aggregate.
It would be a great design tool, but it could also make engineering solutions that are much more structured and result in more useful generated code…
A Modern Software Factory?
The new version of the software factory can be built for and deployed in a containerized environment.
Rebuilding an entirely new fleet of model types would take the modernization process to another level and start building on a much stronger foundation.
And, of course, all those new models will be generated using the SF…