Научная статья на тему 'Unified metamodel of object system'

Unified metamodel of object system Текст научной статьи по специальности «Компьютерные и информационные науки»

CC BY
172
77
i Надоели баннеры? Вы всегда можете отключить рекламу.
Ключевые слова
DDD / OBJECT SYSTEM METAMODEL / OBJECT-ORIENTED SYSTEM / INFORMATION SYSTEM / DATABASE

Аннотация научной статьи по компьютерным и информационным наукам, автор научной работы — Oleynik P.P.

This article describes the unified metamodel of object system which can be used for domain-driven design (DDD) of information system. At the beginning of the work carried out in-depth analysis of existing studies devoted to the organization different metamodels. Metamodel for representing fragments in the figures presented class diagrams of Unified Modeling Language (UML). In the beginning of this article provides a general diagram which displays important associations. Next are separately shown metaclasses hierarchy which representing the entity classes of domain. There are also metaclasses to represent different types of class attributes. In addition, there are metaclasses to represent methods validation rules and visualization rules. This allows the system to implement the behavior the need for object-oriented design and allows to configure the graphical user interface. Each hierarchy is described in detail with an indication of abstract and concrete classes and associations in which they participate. Any database system can be developed in terms of a unified metamodel of object system described in detail in this article. This article provides links to the work that is described in detail the experience of using the described metamodel. As further development of the work the author suggest the development of a formal mathematical apparatus describing applied domains and the development of UML-profile that facilitates the process of logical design of information systems in the framework of the proposed approach.

i Надоели баннеры? Вы всегда можете отключить рекламу.
iНе можете найти то, что вам нужно? Попробуйте сервис подбора литературы.
i Надоели баннеры? Вы всегда можете отключить рекламу.

Текст научной работы на тему «Unified metamodel of object system»

11. Object Management Group. UML 2.0 Infrastructure Specification, OMG document number formal/2011-08-05, 2011.

UNIFIED METAMODEL OF OBJECT SYSTEM

Pavel P. Oleynik, PhD, System Architect Software, Aston JSC, Associate Professor, Shakhty Institute (branch) of Platov South Russian State Polytechnic University (NPI), Russia, Rostov-on-Don, xsl@list.ru

This article describes the unified metamodel of object system which can be used for domain-driven design (DDD) of information system. The idea of the design based on the metamodel is not new since metamodels are used everywhere. Works [1-3] represent the metamodel of object database compliant with the ODMG standard. The SQL:2003 standard includes metamodel that describes the object extensions of SQL [1, 3-4]. The graphical modeling language UML which is often used in the design of modern applications has the standard which governs its own metamodel described in [3, 5].

Practically all the metamodels have some disadvantages. Each author was trying to solve the problem own forces. Thus, in [3], the author has developed its own metamodel for implementing object database.

Metamodel does not exist independently of the rest of the application, and serves a certain purpose. So in [6-7] metamodel is used to facilitate the process of domain-driven design.

Metamodel is also used in the model transformations. So in [8-9] the principles of model transformations from the UML metamodel in the models of languages developed by the authors are described.

Mechanisms for evaluating the software quality based on metamodel with the introduction of various metrics are considered in [10-11]. Publications [12-13] are devoted to questions of the expansion of existing metamodels by adding new elements. In [1], the author offers his own hierarchy of atomic literal types, which can be used in any object system and built thanks to the author's experience.

In this article, we briefly review the metamodel used in a unified development environment for the rapid development of enterprise information systems, SharpArchitect RAD Studio [14]. In [6-7, 15-18] the full class diagram of metamodel was presented and detailed assignment of classes were described. Here we consider only the relevant parts for this article. Fig. 1 shows a fragment of a unified metamodel of object system with display of the key associations that are important for further discussion.

Consider some of the key hierarchies of metaclasses. Fig. 2 is a diagram of the basic metaclasses used to represent different kinds of classes applied to describe the entity classes which are presented in the domain model.

An abstract metaclass Class is the root of the hierarchy. It has two inherited classes: 1) InheritableClass is used to represent metaclasses that can be inherited, i.e. support inheritance; 2) NotInheritableClass is used to represent metaclasses that can not be inherited. Metaclass Enum allows submit an enumeration or a set of values of a simple type.

Abstract base metaclass CustomAttributedClass is used to represent metaclasses that have the attributes. Metaclass DomainClass is used to represent domain classes. Instances of domain classes allow to describe the entity classes (such as Customers, Products, Sales), which objects (eg, Ivanov, Bread) are stored in the database. To simplify the description instances of the domain classes will be called just domain classes (if not assumed otherwise).

Abstract metaclass ComputationalClass<TBaseClass> is the base for all calculated metaclasses ie those classes instances of which are not stored in the database and are computed at runtime (transient). For example, the turnover balance sheet is not stored directly in the database, and is calculated based on inventory, receipts and expenditures (which are the domain classes and

79

represent the instances of the metaclass DomainClass).

Metaclass MethodParameterClass is used to represent a Parameter Class of methods. A design pattern called Parameter object, the essence of which is the transfer of a set of parameters in the method as a single object (an instance of the metaclass) is implemented in SharpArchitect RAD Studio.

Abstract metaclass CodeComputationalClass<TBaseClass> is the base for calculated metaclasses implemented using code in the language of C#. QueryClass is metaclass of query allowing to form the result based on queries to the database (usually based on Linq-object request but SQL-lines are also possible). HelperClass is used to represent the auxiliary metaclasses that can be displayed in the user interface and used for internal purposes in the implementation of business logic.

Now consider the metaclasses used to describe the class attributes shown in Fig. 3. Root abstract metaclass representing an attribute is AbstractAttribute. Classes inherited from VirtualAttribute are used to represent attributes that were not created by the developer of the application domain, and were presented to the system. They are necessary for an understanding of the metamodel and simplify the software development process. SystemAttribute allows to describe the attributes that are system and are presented at the language of C#. Metaclass GeneratedAttribute is used to represent attributes automatically generated by the system. For example, if inheriting from the base tree class an attribute Node, which allows to get the child nodes and thus to form a hierarchical structure, are automatically added.

Fig. 1 - Fragment of a unified metamodel of object system

80

Fig. 2 - Basic metaclasses used to represent the entity classes of the domain model

An abstract base metaclass ConcreteAttribute is used for presentation of attributes whose values can be defined by the user. Since the system is implemented in the language of C #, when saving values in the database the data types of this language are used. To describe this moment parameterized metaclass TypedAttribute<TDefaultValue> was added. TypeAttribute is used to represent the properties whose values can store a reference to the data type of the C# language. Metaclass ClassedValueAttribute<TValueClass, TDefaultValue> is used to represent attributes whose values are the instances of the different instances of entity classes present in the domain. Metaclass NotInheritableClassedValueAttribute<TValueClass, TDefaultValue> retains instances of non-inherited classes. For example, EnumAttribute inherited from the one described is used to store values of enumerations / sets.

Abstract metaclass MultiplicityClassedValueAttribute<TValueClass, TDefaultValue> is used to represent the values of the attributes that can store not only atomic values but also a collection of values. Metaclass DesignTimeClassedValueAttribute <TValueClass, TDefaultValue> allows saving a reference to instances of design time. So BuiltInClassAttribute is used to store objects of classes in the metamodel implementation in SharpArchitect RAD Studio. In its turn MetaModelClassAttribute saves information about the class metamodel of the application domain. Both described metaclasses allow manipulate metamodel at the moment of runtime. A similar approach is used in many modern programming languages supporting an extensive metainformation. So in C # there is a technology of reflection, which allows realizing such things.

Metaclass CustomAttributedClassedValueAttribute <TValueClass, TDefaultValue> is used to store instances of classes with attributes. The system has two child classes: 1)

DomainClassAttribute saves a reference to the instance of a domain entity described in the metamodel using an instance of domain metaclass. Attribute of this type is used for the organization of the association relationships and serves to represent the relations with the object design of the domain. Metaclass HelperClassAttribute allows saving references to instances of helper classes.

Metaclass SimpleTypedAttribute <TDefaultValue> is abstract and serves the root of all the attributes to save the atomic literal value. All of this hierarchy is the result of many years of work, the premise of which and the intermediate solutions have been described in [1]. Metaclass ColorAttribute is used to store the color in the format of RGB. LogicalAttribute is used for storing Boolean values (true and false). Metaclass DateTimeAttribute is used to save the date-time values.

81

If you want to present time only you should use TimeAttribute. There is metaclass MoneyAttribute for submission to the money attribute in the hierarchy. FileDataAttribute is used to save files of various formats.

Attribute of type ObjectAttribute should be used to store any type of object. This approach is similar to the use of type object in C#. Attributes of types GeographyAttribute and GeometryAttribute are used to save the geographical coordinates and geometric objects, respectively. Metaclasses StringAttribute and SymbolAttribute are used to represent character strings and individual characters respectively. If you want to save the text of unlimited length and with formatting you should use TextAttribute. Metaclass HyperLinkAttribute is used to represent hyperlinks to various resources. ImageAttribute is used for storing graphics (pictures, photographs and the like). Parameterized abstract metaclass TypedValueRangedAttribute <TDefaultValue, TValueRange> is used to represent atomic values, which may be within a certain range of values specified by the relevant enumeration (parameter TValueRange). Inherited metaclass IntAttribute can be used to store integer values and DecimalAttribute can be used to represent fractional values.

To implement the behavior in SharpArchitect RAD Studio different syntactic constructions and metaclasses are used. Class methods, metaclasses of which are shown in Fig. 4 are the most commonly used.

Method is the root abstract metaclass of method. Currently, the system supports only the methods implemented in the form of program code and submitted as instances of metaclasses inherited from CodeMethod. Metaclass VisualCodeMethod will create a visual method, which is displayed to the user in the form of a graphic element in the interface. HelperCodeMethod is a helper method that is used to call other methods and properties and is not involved in forming the interface.

Events are an integral part of behavior used in the development of object-oriented applications. Fig. 5 shows metaclasses allowing to describe the various events of objects. The hierarchy is very simple. Event is the root abstract metaclass represented an event. AfterChangedAttributeValueEvent describes events of changing the attribute values and has in its

82

composition, not only the name of the changed attribute, but also the possibility of obtaining the values before and after the change. Event AfterDeletedEvent is called after the removal of the object. Note that the object is not physically removed from the database, but only marked as deleted. This is due to the possible presence of links to other objects and the need to provide an opportunity to recover accidentally deleted object. Exactly after the installation of this label the event is called. Metaclass AfterLoadedEvent allows to create an event handler that occurs after loading the object from the database. Metaclass AfterSavedEvent describes an event that occurs after saving the object in the database. Metaclass BeforeDeletingEvent is used to represent an event that occurs before the removal of the object. If you want to perform certain actions before saving you must create an instance of the metaclass BeforeSavingEvent. The code of the new object initialization is performed in the object of type InitializationEvent.

Fig. 4 - Basic metaclasses used to represent the class methods

Fig. 5 - Basic metaclasses used to represent events

At present an essential step in the development of any large system is to write validation rules that are checked at a certain time (usually while maintaining the object) and confirm the integrity and consistency of data. Hierarchy of validation rules is shown in Fig. 6. ValidationRule is the root abstract metaclass. ClassCheckingValidationRule is directly inherited from it and allows to describe the rules for checking the conditions at the class level (because it implements the interface IClassLevelValidationRule). Metaclass InvertableClassCheckingValidationRule enables to describe invertible conditions. Implemented metaclass CriteriaCheckingValidationRule allows to set the logical test condition as a string and specify a set of attributes that violate this condition. ConcreteAttributesValidationRule describes the validation rules that involve the certain class attributes inherited from ConcreteAttribute. Derived metaclass RequiredAttributesValidationRule enables to specify which class attributes are mandatory and can not contain null values. The derivatives from the parameterized abstract metaclass TypedAttributesValidationRule <TAttribute> allow to describe validation rules that apply only to the attributes of a certain type (of the type specified in TAttribute). Metaclass RegularExpressionAttributesValidationRule is used to specify a regular expression that values of the string attributes (StringAttribute) must match.

Parameterized abstract metaclass TypedValueRangedAttributesValidationRule <TValueRanged Attribute, TValueType> is used to create validation rules of entering values in a certain range. Its children RangeDateTimeAttributesValidationRule, RangeDecimal AttributesValidationRule, RangeTimeAttributesValidation Rule, RangeIntAttributesValidationRule are used to specify a range of datetime, decimal, time and integer attributes, respectively.

UniqueCombinationAttributesValidationRule is the base abstract metaclass specifying a unique combination of attribute values. Its child UniqueCombinationSimpleAttributes ValidationRule is used when defining a unique combination of simple atomic values. Another child

83

UniqueCombinationRunTimeClassedCollectionAttributesValidationRule <TClassValueAttribute> is used for attributes that represent a collection of values and allows to determine the unique attributes for each element in the collection. At the moment, there is only one inherited implemented metaclass UniqueCombinationDomainClassCollectionAttributesValidationRule, which allows setting a unique combination of values for attributes of the domain entities.

In big applications, there is the problem of highlighting of separate fields, columns or rows depending on their values. In addition, it is often necessary to hide or to deactivate some input fields or hide them from the form.

Hierarchy of metaclasses of visualization rules, shown in Fig. 7, solves this problem. VisualizationRule is the root base metaclass. ActionsVisualizationRule allows to describe the visualization rules for the various actions, such as the Save button, the Create New button, the Edit button, etc. Metaclass AttributesVisualizationRule describes the visualization rules for class attributes. Instances of MethodsVisualizationRule permit to define rules for visualization methods (Instances of VisualCodeMethod).

As can be seen, SharpArchitect RAD Studio is a mature software product designed for the development of object-oriented database applications, and provides a unified metamodel enabling to describe both static and dynamic elements of the application. The IDE has been tested on different projects, described in [19-20].

VaiidationRuie

Abstract Class -R NamedMetaModelltem

) IAttributeLevelValidationRule

Con ere teAttrib utes VaSida tionRde

Abstract Class ^ VaiidationRuie

RequiredAttributesValidationRule

Class

-R CoricreteAttnbijtesValidationP.'jle

) ICIassLeyelValidationRule

„ .................................................

^ ICompatableWithMasterType<TAttributej ConcreteAttribute>

TypedAtMbutesVaiidationRuie<TAttrixjte> t

Generic Abstract Class ■R Concrete Attributes VaiidationRuie

UniqueCombinationAttributesVaiidationRde

Abstract Class

-A ConcreteAttributes VaiidationRuie

ClassChe eking VaiidationR uie

Abstract Class -R VaiidationRuie

Q

In vertable ClassChe eking Vaiida tionRde

Abstract Class

-R ClassCheckingValidationRule

CriteriaCheckingValidationRule Y

Class

-R InvertableClassCheckingValidationRiJe

) IAttributeLevelValidationRule

) ICIassLeyelValidationRule

RegularExpressionAttributesValidationRule

Class

-R Typed AttributesValidationRula «String Attribute>

UniqueCombinationSimpleAttributesValidationRule

Class

-R UniqueCombinationAttributesValidationRiJa

Q IAttributeLevelValidationRule (___________________________________________________________

I IUniqueCombinationRunTimeClassedCollectionAttributesValidationRule<TdassValueAttribute>

I ICompatableWithMasterTypedTCIassValueAttribute, ConcreteAttribute>

7 IAttributeLevelValidationRule

ITypedValueRangedAttributesValidationRule

LiniqueCombinationRunrimeCtassedCoIiectionAttributesVa/idationRu/e crclassVa/ueAttrixjto

Generic Abstract Class

^ UniqueCombination Attributes ValidationRite

TypedVaiueRangedAttributesVaUdationRule<rVahieRangedAttributer TVakxType> Y RangelntAttributesValidationRule Y

Generic Abstract Class <1- Class

-R Typed AttributesValidationRule<TValueRangedAttribute> ■R TypedValueRangedAttributesValidationRule-elntAttribute, int>

RangeDateTimeAttributesValidationRule

Class

-R Ту pedValueRangedAttributes VaiidationRuie «DateTime Attribute, Date Times

RangeTimeAttributesValidationRule

Class

■R Ту pedValueRangedAttributesValidationRule «Time Attribute, TimeSpan =■

RangeDecimalAttributesValidationRule «R

Class

-R ТуpedValueRangedAttributesValidationRule«DecimalAttribute, floats

UniqueCombinationDomainClassCollectionAtti-ibutesValidationRule %

Class

-R UniqueCombinationRunTimeClassedCollectionAttributesValidaUonRules:DomainClassAttrbjte>

Fig. 6 - Basic metaclasses used to represent the validation rules

iНе можете найти то, что вам нужно? Попробуйте сервис подбора литературы.

Fig. 7 - Basic metaclasses used to represent the visualization rules

Any database system can be developed in terms of a unified metamodel of object system described in detail in this article. As further development of the work the author suggest the development of a formal mathematical apparatus describing applied domains and the development of UML-profile that facilitates the process of logical design of information systems in the

84

framework of the proposed approach.

References

1. Oleynik P.P. Implementation of the Hierarchy of Atomic Literal Types in an Object System Based of RDBMS // Programming and Computer Software, 2009, Vol. 35, No.4, pp. 235-240.

2. Cattell R.G., Barry D.K. The Object Data Standard:ODMG 3.0, Morgan Kaufmann Publishers, 2000,

288p.

3. Habela P. Metamodel for Object-Oriented Database Management Systems. Ph.D. Thesis // Submitted to the Scientific Council of the Institute of Computer Science, Polish Academy of Sciences, 2002, 142p.

4. Information technology — Database languages — SQL — Part 2: Foundation (SQL/Foundation), http://wiscorp.com/sql200n.zip.

5. Iyengar S., Brodsky S. Metadata Integration using UML, MOF and XMI, November 2000, 88p.

6. Oleynik P.P. Domain-driven design the database structure in terms of metamodel of object system // Proceedings of 11th IEEE East-West Design & Test Symposium (EWDTS'2013), Institute of Electrical and Electronics Engineers (IEEE), Rostov-on-Don, Russia, September 27 - 30, 2013, pp. 469-472.

7. Oleynik P.P. Using metamodel of object system for domain-driven design the database structure // Proceedings of 12th IEEE East-West Design & Test Symposium (EWDTS’2014), Kiev, Ukraine, September 26 - 29, 2014, DOI: 10.1109/EWDTS.2014.7027052

8. Soon-Kyeong K., Carrington D., Duke R. A metamodel-based transformation between UML and Object-Z // Human-Centric Computing Languages and Environments. Proceedings IEEE Symposia, 2001, 112-119 pp.

9. Rahim L.A. Mapping from OCL/UML metamodel to PVS metamodel //Information Technology, ITSim 2008. International Symposium, 2008, 1 - 8 pp.

10. McQuillan J.A., Power J.F. A Metamodel for the Measurement of Object-Oriented Systems: An Analysis using Alloy // Software Testing, Verification, and Validation, 2008 1st International Conference, 2008, 288 - 297 pp.

11. Debnath N., Riesco D., Montejano G., Uzal R., Baigorria L., Dasso A., Funes A. A technique based on the OMG metamodel and OCL for the definition of object-oriented metrics applied to UML models // Computer Systems and Applications, 2005. The 3rd ACS/IEEE International Conference, 2005.

12. Debnath N., Riesco D., Montejano G., Grumelli A., Maccio A., Martellotto P. Definition of a new kind of UML stereotype based on OMG metamodel // Computer Systems and Applications, 2003. Book of Abstracts. ACS/IEEE International Conference, 14-18 July 2003.

13. Misbhauddin M. , Alshayeb M. Extending the UML Metamodel for Sequence Diagram to Enhance Model Traceability // Software Engineering Advances (ICSEA), 2010 Fifth International Conference, 22-27 Aug. 2010, 129 - 134pp.

14. Oleynik P.P., Computer program "The Unified Environment of Rapid Development of Corporate Information Systems SharpArchitect RAD Studio", the certificate on the state registration № 2013618212/ 04 september 2013. (In Russian).

15. Oleynik P.P. Class Hierarchy of Object System Metamodel // Object Systems - 2012: Proceedings of the Sixth International Theoretical and Practical Conference. Rostov-on-Don, Russia, 10-12 May, 2012. Edited by Pavel P. Oleynik. 37-40 pp. (In Russian), http://obiectsvstems.ru/files/2012/Qbiect Systems 2012 Proceedings.pdf

16. Oleynik P.P. Class Hierarchy for Presentation Validation Rules of Object System // Object Systems -2013: Proceedings of the Seventh International Theoretical and Practical Conference (Rostov-on-Don, 10-12 May, 2013) / Edited by Pavel P. Oleynik. - Russia, Rostov-on-Don: SI (b) SRSTU (NPI), 2013. 14-17pp. (In Russian), http://obiectsvstems.ru/flles/2013/Obiect Systems 2013 Proceedings.pdf

17. Oleynik P.P. The Elements of Development Environment for Information Systems Based on Metamodel of Object System // Business Informatics. 2013. №4(26). - pp. 69-76. (In Russian), http://bhournal.hse.ru/data/2014/01/16/1326593606/1BI%204(26)%202013.pdf

18. Oleynik P.P. Domain-driven design of the database structure in terms of object system metamodel // Object Systems - 2014: Proceedings of the Eighth International Theoretical and Practical Conference (Rostov-on-Don, 10-12 May, 2014) / Edited by Pavel P. Oleynik. - Russia, Rostov-onDon: SI (b)

85

SRSPU (NPI), 2014. - pp. 41-46. (In Russian),

http://obiectsvstems.ru/files/2014/Qbiect Systems 2014 Proceedings.pdf

19. Oleynik P.P., Kurakov Yu.I. The Concept Creation Service Corporate Information Systems of Economic Industrial Energy Cluster // Applied Informatics. 2014. №6. 5-23 pp. (In Russian).

20. K.Q. Kozlova, P.P. Oleynik. Experience of Using Multiple Inheritance in Modern Programming

Languages // Object Systems - 2014 (Winter session): Proceedings of IX International Theoretical and Practical Conference (Rostov-on-Don, 10-12 December, 2014) / Edited by Pavel P. Oleynik. - Russia, Rostov-on-Don: SI (b) SRSPU (NPI), 2014. - pp. 10-12. (In Russian),

http://obiectsystems.ru/files/2014WS/Obiect Systems 2014 Winter session Proceedings.pdf

УДК 004.04

ПРЕДМЕТНО-ОРИЕНТИРОВАННОЕ ПРОЕКТИРОВАНИЕ ИНФОРМАЦИОННОЙ

СИСТЕМЫ САЛОНА КРАСОТЫ

Козлова Ксения Олеговна, студентка, Ивановский государственный химико-технологический университет, Россия, Иваново, ksu932011@mail.ru

Бородина Наталья Евгеньевна, студентка, Ивановский государственный химико-технологический университет, Россия, Иваново, natashka0108@yandex.ru

Галиаскаров Эдуард Геннадьевич, к.х.н., доцент, Ивановский государственный химикотехнологический университет, Россия, Иваново, portugaled@yandex.ru Олейник Павел Петрович, к.т.н, системный архитектор программного обеспечения,

ОАО "Астон", доцент, Шахтинский институт (филиал) Южно-Российского государственного политехнического университета им. М.И. Платова, Россия, Ростов-на-Дону, xsl@list.ru

Введение

В настоящее время все чаще используется предметно-ориентированное проектирование приложений баз данных. В данной статье представлен пример предметно-ориентированного проектирования и реализации информационной системы салона красоты, для которой использовалась собственная метамодель объектной системы и собственная среда разработки. Структура данной статьи следующая. В разделе 1 дается краткий обзор имеющихся работ, посвященных разработке метамоделей объектных систем. В разделе 2 представлены критерии оптимальности, которые были выдвинуты при разработке информационной системы. В разделе 3 представлена модель предметной области информационной системы салона красоты, указаны взаимосвязи между классами. Описание подтверждает соответствие выделенным критериям оптимальности системы. В заключении даны выводы о результатах проделанной работы, а также намечены направления дальнейшего развития работы.

1. Обзор имеющихся работ

В данной статье представлено описание предметно-ориентированного проектирования информационной системы салона красоты в понятиях унифицированной метамодели объектной системы. Салон красоты выбран именно потому, что эта тема наиболее близка одному из авторов работы, являющимся экспертом в этой области. В общем случае предметная область не имеет ключевого значения, т.к. метамодель унифицированная и может быть использована в любом приложении баз данных.

Идея проектирования на основе метамодели не нова, т.к. метамодели используются повсеместно. В работах [1-3] представлена метамодель объектных баз данных, соответствующих стандарту ODMG. В стандарте SQL:2003 также имеется метамодель, описывающая объектные расширения языка SQL [1, 3-4]. При проектировании современных приложений чаще всего используют графический язык моделирования UML, стандарт которого регламентирует собственную метамодель, описанную в работах [3, 5].

86

i Надоели баннеры? Вы всегда можете отключить рекламу.