Change in the Metamodel Architecture of CAF Core project
We know that CAF Core is a metamodel based development framework for developing composite applications in SAP. In NW07 (NW04s), when a CAF Core project is created in the CAS (Composite Application Service) of NWDS, the project folder with certain sub folder gets created (Fig 1 and 2). The metamodel information is stored in multiple xml files grouped under a certain folder structure.
Fig 1: Simple CAF Core project in NW07
The content of these xml files are very much proprietary and difficult to understand (one of them shown below). Actually in a normal development situation one does not need to understand the content. From the content of these xml files (metamodel), NWDS renders the artifacts of a CAF Core project. Where the CAF Core project is changed during the development, the appropriate xml file(s) get updated accordingly.
The architecture CAF Core project has changed in CE 7.1. For each Business Object (BO) created within a CAF project, a structure gets created automatically. This is visible under the “Data Types” node shown below. It is also possible to associate an existing structure as an attribute of a BO.
Fig 3: Simple CAF Core project in CE7.1
As part of this major enhancement, SAP has changed the metamodel framework of CAF project. Instead of the cryptic xml files (as in NW07), the metamodel is now stored in one single file with .cafmm extension. This is based on Eclipse Metamodel Framework (Eclipse Modeling Framework (EMF) ) which is a more standard approach of defining a metamodel. In CE, when a CAF project is created in the CAS perspective of NWDS, this .cafmm gets generated within a specific folder (shown below).
Some interesting possibilities
The EMF based metamodel file (.cafmm) is one single file from which all the artifacts of a CAF Core project
can be generated in NWDS. Think of a situation where for some reason, the CAF Core project has got corrupted. In that case, all the artifacts (Business Objects, Application Services, imported External Services etc.) of the same CAF Core project can be retrieved from this .cafmm file. Only thing that the developer has to do is to create a new CAF Core project, replace the default .cafmm file with the previous one, select Reload option from the context menu of the CAF Core project.
Perhaps this is one of the most interesting changes from the architecture point of view. There are several other possibilities which I will try to explore and share in the future.