DE102012202603B3 - Method for model-based software developing of programs with database access, involves converting old database entries into new database entries and/or converting old data schemas into new database schemas - Google Patents
Method for model-based software developing of programs with database access, involves converting old database entries into new database entries and/or converting old data schemas into new database schemas Download PDFInfo
- Publication number
- DE102012202603B3 DE102012202603B3 DE201210202603 DE102012202603A DE102012202603B3 DE 102012202603 B3 DE102012202603 B3 DE 102012202603B3 DE 201210202603 DE201210202603 DE 201210202603 DE 102012202603 A DE102012202603 A DE 102012202603A DE 102012202603 B3 DE102012202603 B3 DE 102012202603B3
- Authority
- DE
- Germany
- Prior art keywords
- database
- entries
- old
- new
- history
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/35—Creation or generation of source code model driven
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Description
Die Erfindung betrifft ein Verfahren zu Softwareentwicklung, bei dem verschiedene Programmversionen unterschiedliche Persistenzschemata aufweisen und somit auch eine Datenbank-Migration erfordern.The invention relates to a method for software development, in which different program versions have different persistence schemes and thus also require a database migration.
Eine typische Situation besteht beispielsweise darin, dass ein Anwender eine alte Version eines Softwaresystems mit Datenbank einsetzt und eine neue Version des Softwaresystems mit Datenbank erstellt wurde, bei der sich vom Anwender gespeicherte Datentypen und Datenstrukturen ändern. Der Anwender möchte die neue Version des Softwaresystems verwenden und dabei seine bereits gespeicherten Daten weiter verwenden.For example, a typical situation is where a user is using an old version of a software system with database and a new version of the software system has been created with a database that changes user-stored data types and data structures. The user wants to use the new version of the software system while continuing to use his already stored data.
In diesem Fall reicht es nicht aus, dass der Anwender die neue Version installiert, sondern er muss seine alte Datenbank migrieren, damit die neue Software mit den bereits gespeicherten Daten ablaufen kann. Dies beinhaltet zwei Schritte: es müssen die Datenbankschemata geändert werden und es müssen die Datenbankeintrage in Form der neuen Schemata abgespeichert werden.In this case, it is not enough for the user to install the new version, but he must migrate his old database so that the new software can run with the data already stored. This involves two steps: changing the database schemas and saving the database entries in the form of the new schemas.
Dieses Problem wurde bisher so gelöst, dass von Hand ein SQL-Skript erstellt wurde. Dieses Skript enthielt Anweisungen, um die neuen Schemata zu erstellen. Weiterhin enthielt dieses Skript für jeden Datenbankeintrag, dessen Datentyp geändert wurde, SQL-Anweisungen, die ihn durch einen Eintrag des neuen Datentyps unter Übernahme der Werte aus dem alten Datenbankeintrag ersetzen.This problem has been solved so far that a SQL script was created by hand. This script contained instructions to create the new schemas. Furthermore, for each database entry whose data type was changed, this script contained SQL statements that replace it with an entry of the new data type, taking over the values from the old database entry.
Aus der Patentanmeldung US 5 642505 A sind Systeme zur Sicherung, Wiederherstellung und Migration von Datenbanken bekannt.From patent application US 5 642 505 A systems for backup, restore and migration of databases are known.
Ferner sind aus der Patentanmeldung
Außerdem sind aus der Patentanmeldung
Schließlich sind aus der Patentanmeldung
Die der Erfindung zu Grunde liegende Aufgabe besteht nun darin, ein Verfahren zur modellbasierten Softwareentwicklung von Programmen mit Datenbankzugriff anzugeben, bei dem eine möglichst einfache und sichere Datenbank-Migration ermöglicht wird.The object underlying the invention is now to provide a method for model-based software development of programs with database access, in which the simplest possible and secure database migration is made possible.
Diese Aufgabe wird durch die Merkmale des Patentanspruchs 1 erfindungsgemäß gelöst. Die weiteren Ansprüche betreffen bevorzugte Ausgestaltungen der Erfindung und eine Vorrichtung zur Durchführung des Verfahrens.This object is achieved by the features of
Die Erfindung betrifft im Wesentlichen ein Verfahren zur modellbasierten Softwareentwicklung von Programmen mit Datenbankzugriff, bei dem gleichzeitig mit der Erzeugung oder Änderung von Metamodellen Einträge in eine Historienliste generiert werden und diese dann zur automatischen Erzeugung eines SQL-Skriptes verwendet werden, das eine validierte Migration vom alten zum neuen Schema sowie eine Migration aller Daten erlaubt. Der Vorteil besteht darin, dass Aufwand gespart wird und Qualität durch automatisches Validieren und Testen gewonnen wird.The invention generally relates to a method for model-based software development of programs with database access, in which, simultaneously with the generation or modification of meta-models, entries are generated in a history list and these are then used to automatically generate an SQL script that performs a validated migration from the old one to the new scheme as well as a migration of all data allowed. The advantage is that effort is saved and quality is gained through automatic validation and testing.
Nachfolgend wird die Erfindung anhand eines in der Zeichnung dargestellten Ausführungsbeispiels näher erläutert.The invention will be explained in more detail with reference to an embodiment shown in the drawing.
In der modellgetriebenen Softwareentwicklung werden domänenspezifische Sprachen verwendet, um Klassen im Sinne objektorientierter Programmierung mit Metamodellen programmiersprachenunabhängig zu beschreiben.In model-driven software development, domain-specific languages are used to describe classes in the sense of object-oriented programming with meta-models independent of programming languages.
In der Zeichnung ist eine Anordnung mit einem Editor ED, der sowohl ein jeweiliges Metamodell M1, M2 erzeugt/löscht oder ändert als auch eine jeweilige Historienliste HL1, HL2 mit diesen Änderungen erzeugt/löscht oder ändert, einem Generator KG, der aus dem jeweiligen Modell jeweilige Datentypen DT1, DT2 erzeugt, einer jeweiligen Datenbank DB1, DB2, bei der diese Datentypen über jeweilige Datenbankschemata DS1, DS2 auf jeweilige Datenbankeinträge DE1, DE2 abgebildet werden, und einer Migrationsmaschine (Migration Engine) ME, die aus Einträgen HE1, HE2 der jeweiligen Historienlisten HL1, HL2 ein Skript S zur Änderung der jeweiligen Datenbankschemata und jeweiligen Datenbankeinträge bildet, gezeigt.In the drawing, an arrangement with an editor ED, which generates / deletes or alters both a respective meta-model M1, M2, as well as generates / deletes or alters a respective history list HL1, HL2 with these changes, a generator KG, from the respective model respective data types DT1, DT2 generates, a respective database DB1, DB2, in which these data types are mapped via respective database schemas DS1, DS2 to respective database entries DE1, DE2, and a migration engine ME, consisting of entries HE1, HE2 of the respective History lists HL1, HL2 forms a script S for changing the respective database schemas and respective database entries shown.
Die jeweiligen Metamodelle M1 einer alten Programmversion werden zusammen mit den Historieneinträgen HE1 als Attribut in einem Container verwaltet und die Metamodelle M2 einer neuen Programmversion werden zusammen mit Historieneinträgen HE2 als Attribut in einem weiteren Container verwaltet.The respective meta-models M1 of an old program version are managed together with the history entries HE1 as an attribute in a container, and the meta-models M2 of a new program version are managed together with history entries HE2 as an attribute in another container.
Bei Erzeugung, Änderung, Löschung eines Metamodells wird automatisch auch ein Eintrag HE1, HE2 in dieser Historienliste HL1, HL2 erzeugt. Dieser Eintrag enthält alle Informationen, die notwendig sind, um ein entsprechendes Datenbankschema DS1, DS2 zu erzeugen, zu ändern oder zu löschen, wie z. B. den Namen und den Datentyp eines neu zu einem Metamodell hinzugefügten Attributes. Ein Historieneintrag ist selbst auch als Metamodell modelliert.Upon generation, modification, deletion of a meta-model, an entry HE1, HE2 is automatically generated in this history list HL1, HL2. This entry contains all the information necessary to create, modify or delete a corresponding database schema DS1, DS2, such as: For example, the name and data type of an attribute newly added to a meta-model. A history entry is itself modeled as a meta-model.
Mit Hilfe des programmierten Generators KG werden aus den Metamodellen Programmiersprachenkonstrukte, z. B. Java Klassen, erzeugt, die typischerweise die Eigenschaften von Objekten definieren.With the help of the programmed generator KG, programming language constructs, e.g. Java classes, which typically define the properties of objects.
Für die Abbildung von Objekten in eine relationale Datenbank wird ein Framework für objektrelationales Mapping (ORM) verwendet. Typischerweise bieten die Datenbank-Hersteller dort eigene Implementierungen an, es gibt aber auch Open-Source Persistenzprovider. Der Open-Source Persistenzprovider „Hibernate” ermöglicht z. B., gewöhnliche Objekte mit Attributen und Methoden in relationalen Datenbanken zu speichern und aus entsprechenden Datensätzen wiederum Objekte zu erzeugen. Beziehungen zwischen Objekten werden dabei auf entsprechende Datenbank-Relationen abgebildet.Mapping objects to a relational database uses a framework for object-relational mapping (ORM). Typically, the database manufacturers offer their own implementations, but there are also open source persistence providers. The open-source persistence provider "Hibernate" allows z. For example, you can store ordinary objects with attributes and methods in relational databases and then create objects from corresponding data sets. Relationships between objects are mapped to corresponding database relations.
Die Migrationsmaschine ME arbeitet wie folgt:
Sie hat Zugriff auf den Metamodell-Container des alten Systems und auf den des neuen Systems.The migration engine ME works as follows:
It has access to the meta-model container of the old system and that of the new system.
Durch Vergleich der Historieneinträge in der Historienliste HL2 für ein Metamodell M2 im neuen System und der Historieneinträge in der Historienliste HL1 für ein Metamodell M1 im alten bzw. ursprünglichen System wird ein Einstiegszeitpunkt (entry point) bestimmt. Dies ist der Zeitpunkt, ab dem die Historieneinträge im neuen System berücksichtigt werden müssen.By comparing the history entries in the history list HL2 for a meta-model M2 in the new system and the history entries in the history list HL1 for a meta-model M1 in the old or original system, an entry point is determined. This is the time from which the history entries must be taken into account in the new system.
Es wird eine Liste aller relevanten Historieneinträge für alle betroffenen Metamodelle, bspw. die Modelle M1 und M2, erzeugt. Aus diesen Historieneinträgen HE1 und HE2, die ja Instanzen eines Metamodells „Historieneintrag” sind, werden entsprechende Objekte einer Programmiersprache, z. B. Java, erzeugt. Alle diese Javaobjekte zusammen bilden eine Persistenzhistorie ab, die auf der alten bzw. ursprünglichen Datenbank ausgeführt werden muss, wobei eine Persistenzhistorie allgemein beschreibt wie die Daten oder Objekte in nichtflüchtigen Speichermedien, wie Dateisystemen oder Datenbanken, gespeichert wurden und werden.A list of all relevant history entries is generated for all affected meta-models, for example models M1 and M2. From these history entries HE1 and HE2, which are indeed instances of a meta-model "history entry", corresponding objects of a programming language, e.g. B. Java generated. All of these Java objects together form a persistence history that must be executed on the old or original database, with a persistence history generally describing how the data or objects were and are stored in non-volatile storage media, such as file systems or databases.
Je nach Art des Historieneintrags, z. B. „add attribute”, „remove attribute” usw., wird ein entsprechendes Javaobjekt für einen Historieneintrag an einen spezifischen Handler übergeben. Dieser ändert dann das Persistenzschema, z. B. für „Hibernate”, entsprechend und erzeugt SQL-Code, der notwendig ist, um erforderliche Datenbankschemaänderungen vorzunehmen und Datenbankeinträge zu ändern. Als „Handler” (Handhaber) wird üblicherweise eine asynchrone Rückruffunktion verstanden, die einer anderen Funktion als Parameter übergeben und von dieser unter gewissen Bedingungen aufgerufen wird.Depending on the type of history entry, eg. For example, add attribute, remove attribute, and so on, pass a corresponding Java object for a history entry to a specific handler. This then changes the persistence schema, eg. For "hibernate," and generates SQL code necessary to make necessary database schema changes and to change database entries. A "handler" is usually understood as an asynchronous callback function, which is passed to another function as a parameter and is called by it under certain conditions.
In der Migrationsmaschine ME wird der SQL-Code von allen Handlern entsprechend der zeitlichen Reihenfolge der Historieneinträge in einem SQL-Skript gesammelt und optional auch kommentiert mit Hinweisen auf das Metamodell, dessen Änderung die Ursache war. Nach Abarbeitung aller Objekte für Historieneinträge gibt die Migrationsmaschine ME das vollständige SQL-Skript S aus.In the migration engine ME, the SQL code is collected by all handlers according to the time sequence of the history entries in an SQL script and optionally also annotated with pointers to the metamodel whose change was the cause. After processing all objects for history entries, the migration engine ME outputs the complete SQL script S.
Dieses SQL-Skript S kann nun auf die alte Datenbank angewendet werden um sie auf die neue Version des Systems zu migrieren.This SQL script S can now be applied to the old database to migrate it to the new version of the system.
Anschließend kann optional die Migration validiert werden, dadurch dass das Persistenzschema des neuen Systems mit den Datenbankschemata der neuen Datenbank auf Übereinstimmung verglichen wird.Then, optionally, the migration can be validated by comparing the persistence schema of the new system with the database schema of the new database for consistency.
Claims (6)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
DE201210202603 DE102012202603B3 (en) | 2012-02-21 | 2012-02-21 | Method for model-based software developing of programs with database access, involves converting old database entries into new database entries and/or converting old data schemas into new database schemas |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
DE201210202603 DE102012202603B3 (en) | 2012-02-21 | 2012-02-21 | Method for model-based software developing of programs with database access, involves converting old database entries into new database entries and/or converting old data schemas into new database schemas |
Publications (1)
Publication Number | Publication Date |
---|---|
DE102012202603B3 true DE102012202603B3 (en) | 2013-07-04 |
Family
ID=48608151
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
DE201210202603 Expired - Fee Related DE102012202603B3 (en) | 2012-02-21 | 2012-02-21 | Method for model-based software developing of programs with database access, involves converting old database entries into new database entries and/or converting old data schemas into new database schemas |
Country Status (1)
Country | Link |
---|---|
DE (1) | DE102012202603B3 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10552383B2 (en) | 2017-08-11 | 2020-02-04 | Wipro Limited | Method and system for data conversion and data model optimization |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5642505A (en) * | 1993-03-04 | 1997-06-24 | Mitsubishi Denki Kabushiki Kaisha | Backup, restoration, migration systems of a database |
WO2006103098A2 (en) * | 2005-03-31 | 2006-10-05 | Ubs Ag | Computer network system for the establishment synchronisation and/or operation of a second databank from/with a first databank and procedure for the above |
WO2006103096A2 (en) * | 2005-03-31 | 2006-10-05 | Ubs Ag | Computer network system for establishing a second database from, synchronizing and/or operating it with a first database and corresponding procedure |
WO2006103095A1 (en) * | 2005-03-31 | 2006-10-05 | Ubs Ag | Computer network system for synchronizing a second database with a first database and corresponding procedure |
-
2012
- 2012-02-21 DE DE201210202603 patent/DE102012202603B3/en not_active Expired - Fee Related
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5642505A (en) * | 1993-03-04 | 1997-06-24 | Mitsubishi Denki Kabushiki Kaisha | Backup, restoration, migration systems of a database |
WO2006103098A2 (en) * | 2005-03-31 | 2006-10-05 | Ubs Ag | Computer network system for the establishment synchronisation and/or operation of a second databank from/with a first databank and procedure for the above |
WO2006103096A2 (en) * | 2005-03-31 | 2006-10-05 | Ubs Ag | Computer network system for establishing a second database from, synchronizing and/or operating it with a first database and corresponding procedure |
WO2006103095A1 (en) * | 2005-03-31 | 2006-10-05 | Ubs Ag | Computer network system for synchronizing a second database with a first database and corresponding procedure |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10552383B2 (en) | 2017-08-11 | 2020-02-04 | Wipro Limited | Method and system for data conversion and data model optimization |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
DE10121790B4 (en) | Software configuration method for use in a computer system | |
WO2015044374A1 (en) | Method and device for the automated production and provision of at least one software application | |
WO2008040664A1 (en) | Method for the computer-assisted analysis of a software source code | |
EP2332042A1 (en) | Method and device for replacing a component of a computer system | |
WO2015185328A1 (en) | Computer-implemented method and signal sequence for a program for reusing software configurations that can be executed for software systems, and computer system, and a computer program with program code for carrying out the method | |
DE102010033861A1 (en) | On a formal analysis based development of requirements specifications | |
DE102004009676A1 (en) | Methods and systems for generating command support files | |
EP2977888B1 (en) | Method and system for storage and version management of computer programs | |
DE102012202603B3 (en) | Method for model-based software developing of programs with database access, involves converting old database entries into new database entries and/or converting old data schemas into new database schemas | |
DE102021116315A1 (en) | Method for merging architectural information | |
WO2014131430A1 (en) | Method for model-based software development of programs with databank access | |
EP1947567A2 (en) | Device and method for automatically testing model-based functions | |
DE102016005519B4 (en) | Method for creating a metadata data model for a BI infrastructure | |
EP1202166B1 (en) | System for verification of software application models in strings of software development tools | |
DE10346802B4 (en) | Method for processing CDR information | |
DE10233971A1 (en) | Software generating method for a software-controlled device uses a software model implemented as data in a computer to derive software program code automatically from the model | |
DE102017212612A1 (en) | Method for automatically generating tests for the software of a vehicle | |
DE112013004668T5 (en) | Maintaining the integrity of an output of code generators | |
DE102017127400A1 (en) | Commitment of technical development data | |
DE102004020873A1 (en) | A system and method for determining applicable configuration information for use in computer-aided design analysis | |
WO2023280603A1 (en) | Computer-implemented method, computer program and device for extending a graph | |
DE102013006949A1 (en) | Method for ensuring the functionality of a technical system with regard to its configuration during installation or removal of components | |
DE102023106277A1 (en) | Method for generating source code | |
EP3940553A1 (en) | Server system, computer program product and method for providing security-related data by means of a server system | |
DE102008060440A1 (en) | Device, particularly computer unit for providing requirement-conformal source code, has requirement analysis unit for analyzing specified functional or non-functional total requirement of source code |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
R012 | Request for examination validly filed | ||
R016 | Response to examination communication | ||
R018 | Grant decision by examination section/examining division | ||
R020 | Patent grant now final |
Effective date: 20131005 |
|
R119 | Application deemed withdrawn, or ip right lapsed, due to non-payment of renewal fee | ||
R119 | Application deemed withdrawn, or ip right lapsed, due to non-payment of renewal fee |
Effective date: 20140902 |