How to encode the knowledge about SCM features in the code generator is one of the biggest challenges. We need a clean separation of concern for feature representation from other parts in the generated system. Various feature representations should have standard format to make generator implementation easy. Feature composition and customization (e.g., adding or removing features) should be straightforward and inexpensive.
Traditional SCM systems architecture spreads application logic (feature implementations) code across the whole system: in the client, in the middle tier and in the backend repository. It is expensive and slow to make changes--developers need to understand the intricate connections between different tiers. Redundant code that implements similar application logic exist within each tier. Different tiers have different vendors that implement non-standard interfaces, which makes component reuse difficult. Customization and evolution of business logic is hard and expensive.
Rule-based architecture encode the application logic into “business rules” using special rule languages and store rules in the central rule repository. Rule engine queries the rule repository to find matching rules according to requests from client and backend repository. The engine then executes those rules to provide desired services.

We select rule-based architecture to represent features in the generated SCM systems because it has many advantages over the traditional architecture design. Rules are reusable application logic components because the rule languages are independent of programming languages and computing platforms. Rules have recurring ECA (Event-Condition-Action) patterns and rule engine defines standard data and event I/O interfaces, both making code generator implementation a lot easier. Feature composition and customization in CMF and SMF models are made simpler because code generator just needs to create different rules for the rule repository. Advanced technologies in the rule-based system like AI inference engines, pattern matching and fuzzy logic also open the possibilities for automatic feature composition and validation.