Posts

Showing posts from January, 2020

MDSE In Practice - Chapter 1 - Reading Notes

Model-Driven Software Engineering In Practice  - Chapter 1 - Reading notes 1. Introduction It is natural for the human mind to form abstractions (generalisations, classifications, aggregation). Informal definition of a model: "a model as a simplified or partial representation of reality, defined in order to accomplish a task or to reach an agreement on a topic." This implies that a "model will never describe reality in its entirety." [Modeling is natural to humans.  We implicitly use models to help us understand the world.  Even computer programs are models, in a sense.] [As useful as models are, we must be cognizant of the inherent constraint that they do not give a 100% representation of reality.  This is particular true of those models which are defined as being references or blueprints in some form.] 1.1 Purpose and Use of Models Ubiquity of models in diverse fields (Maths, Physics, Philosophy of Science, Engineering). Roles for models Reduct

Creating Items in Sparx EA via Java

Introduction This short post provides guidance on how to create "things" in a Sparx EA model via the Java API. Theory Creating "things" in EA via Java is driven by the Add New method and the Collection class. The first example in the code is adding a "view" to an existing root node. The code below will retrieve the root GUID if the "i" variable is set to 0; rootPackageID = rep . GetModels (). GetAt ( i ). GetPackageGUID (); After obtaining the root GUID it is possible to create a view under the root node. Note the process of retrieving the packages under the root and placing them in a collection. The Add New process is driven from the Collection. Importantly, for a view, the code needs to set a flag which indicates a particular icon. This process is only required for views. org . sparx . Package root = rep . GetPackageByGuid ( rootPackageID ); // get the root Collection < org . sparx . Package > subPackages = r