luận văn thạc sĩ a unified view approach to software development automation

197 29 0
luận văn thạc sĩ a unified view approach to software development automation

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Vietnam National University, Hanoi VNU University of Engineering and Technology LE MINH DUC A Unified View Approach to Software Development Automation Doctor of Philosophy Dissertation in Information Technology Hanoi - 2020 ĐẠI HỌC QUỐC GIA HÀ NỘI TRƯỜNG ĐẠI HỌC CÔNG NGHỆ LÊ MINH ĐỨC PHƯƠNG PHÁP TIẾP CẬN KHUNG NHÌN HỢP NHẤT CHO TỰ ĐỘNG HĨA PHÁT TRIỂN PHẦN MỀM LUẬN ÁN TIẾN SĨ NGÀNH CÔNG NGHỆ THÔNG TIN Hà Nội - 2020 Vietnam National University, Hanoi VNU University of Engineering and Technology LE MINH DUC A Unified View Approach to Software Development Automation Specialisation: Software Engineering Code: 9480103.01 Doctor of Philosophy Dissertation in Information Technology Supervisors: ࿿࿿࿿H࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿I࿿ಾ࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿J࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿K࿿⚠࿿࿿࿿࿿࿿࿿࿿࿿࿿L࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿ M࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿N࿿მ࿿࿿࿿࿿࿿࿿࿿࿿࿿O࿿‫ڗ‬࿿࿿࿿࿿࿿࿿࿿࿿࿿P࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿Q࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿ R࿿࿿࿿࿿61Z࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿[࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿\࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿]࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿^࿿࿿ ࿿࿿࿿࿿࿿࿿࿿࿿࿿_࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿`࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿a࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿b⡰࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿c࿿࿿ ࿿࿿࿿࿿࿿࿿࿿࿿࿿d⢊࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿e࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿f࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿g࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿h࿿࿿ ࿿࿿࿿࿿࿿࿿࿿࿿࿿i࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿j࿿࿿ ࿿࿿࿿࿿࿿࿿࿿࿿࿿k࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿l࿿┹࿿࿿࿿࿿࿿࿿࿿࿿࿿m࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿ n࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿o࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿p࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿q࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿r࿿Ҧ࿿࿿࿿࿿࿿࿿࿿࿿࿿ s࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿t࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿u࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿v࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿w࿿❱࿿࿿࿿࿿࿿࿿࿿࿿࿿ Assoc Prof., Dr Nguyen Viet Ha ࿿࿿࿿H࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿I࿿ಾ࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿J࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿K࿿⚠࿿࿿࿿࿿࿿࿿࿿࿿࿿L࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿ M࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿N࿿მ࿿࿿࿿࿿࿿࿿࿿࿿࿿O࿿‫ڗ‬࿿࿿࿿࿿࿿࿿࿿࿿࿿P࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿Q࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿ R࿿࿿࿿࿿62Z࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿[࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿\࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿]࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿^࿿࿿ ࿿࿿࿿࿿࿿࿿࿿࿿࿿_࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿`࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿a࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿b⡰࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿c࿿࿿ ࿿࿿࿿࿿࿿࿿࿿࿿࿿d⢊࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿e࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿f࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿g࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿h࿿࿿ ࿿࿿࿿࿿࿿࿿࿿࿿࿿i࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿j࿿࿿ ࿿࿿࿿࿿࿿࿿࿿࿿࿿k࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿l࿿┹࿿࿿࿿࿿࿿࿿࿿࿿࿿m࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿ n࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿o࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿p࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿q࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿r࿿Ҧ࿿࿿࿿࿿࿿࿿࿿࿿࿿ s࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿t࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿u࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿v࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿w࿿❱࿿࿿࿿࿿࿿࿿࿿࿿࿿ x࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿y࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿z࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿{࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿|࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿}࿿ ࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿~࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿╦࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿⡧࿿࿿࿿࿿࿿࿿࿿࿿࿿ ࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿ᶑ࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿ ࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿ǝ࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿✗࿿࿿࿿࿿࿿࿿࿿࿿࿿ ࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿⅖࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿٢࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿➂࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿ ࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿ ࿿࿿Ä࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿ ࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿࿿ ĂÂÊÔƠ ƯĐăâ$ êằ ôơđ àảÃáạ ằẳẵắ ặầẩ ẫấậè ẻẽéẹề ểễếệì ỉĩ íịòỏ õóọồổ ỗốộờờở ỡớợù ủũúụừ ửữứựỳ ỷỹýỵ Dr Dang Duc Hanh Hanoi 2020 ĐẠI HỌC QUỐC GIA HÀ NỘI TRƯỜNG ĐẠI HỌC CÔNG NGHỆ LÊ MINH ĐỨC PHƯƠNG PHÁP TIẾP CẬN KHUNG NHÌN HỢP NHẤT CHO TỰ ĐỘNG HÓA PHÁT TRIỂN PHẦN MỀM Chuyên ngành: Kỹ thuật Phần mềm Mã số: 9480103.01 LUẬN ÁN TIẾN SĨ NGÀNH CÔNG NGHỆ THÔNG TIN NGƯỜI HƯỚNG DẪN KHOA HỌC: PGS TS Nguyễn Việt Hà 2 TS Đặng Đức Hạnh Hà Nội – 2020 Declaration I hereby declare that the materials presented in this dissertation are my own work, conducted under the supervision of Assoc Prof., Dr Nguyen Viet Ha and Dr Dang Duc Hanh, at the Faculty of Information Technology, University of Engineering and Technology, Vietnam National University, Hanoi All the research data and results presented in this dissertation are authentic and (to the best of my knowledge) have not previously been published in any academic publications by other authors Le Minh Duc Abstract An important software engineering methodology that has emerged over the past twenty years is model-based software development At the heart of this methodology lies two complementary methods: model-driven software engineering (MDSE) and domain-driven design (DDD) While the aim of MDSE is ambitiously broad, DDD’s goal is more modest and direct but not less important – to apply model-based engineering techniques to tackle the complexity inherent in the domain requirements The state-of-the-art DDD method includes a set of principles for constructing a domain model that is feasible for implementation in a target programming language However, this method lacks the solutions needed to address the following important design questions facing a technical team when applying DDD in object oriented programming language (OOPL) platforms: (i) what constitues an essentially expressive domain model and (ii) how to effectively construct a software from this model The dissertation aims to address these limitations by using annotation-based domain-specific language (aDSL), which is internal to OOPL, to not only express an essential and unified domain model but generatively construct modular software from this model First, we propose an aDSL, named domain class specification language (DCSL), which consists in a set of annotations that express the essential structural constraints and the essential behaviour of a domain class We carefully select the design features from a number of authoritative software and system engineering resources and reason that they form a minimum design space of the domain class Second, we propose a unified domain (UD) modelling approach, which uses DCSL to express both the structural and behavioural modelling elements We choose UML activity diagram language for behavioural modelling and discuss how the domain-specific constructs of this language are expressed in DCSL To demonstrate the applicability of the approach we define the UD modelling patterns for tackling the design problems posed by five core UML activity flows Third, we propose a 4-property characterisation for the software that are constructed directly from the domain model These properties are defined based on a conceptual layered software model that includes the domain model at the core, an intermediate module layer surrounding this core and an outer software layer Fourth, we propose a second aDSL, named module configuration class language (MCCL), that is used for designing module configuration classes (MCCs) in a module-based software architecture An MCC provides an explicit class-based definition of a set of module configurations of a given class of software modules The MCCs can easily be reused to create different variants of the same module class, without having to change the module class design Fifth, we develop a set of software tools for DCSL, MCCL and the generators associated with these aDSLs We implement these tools as components in a software framework, named jDomainApp, which we have developed in our research To evaluate the contributions, we first demonstrate the practicality of our method by applying it to a relatively complex, real-world software construction case study, concerning organisational process management We then evaluate DCSL as a design specification lan-guage and evaluate the effectiveness of using MCCL in modulebased software construction We focus the latter evaluation on module generativity We contend that our contributions help make the DDD method more concrete and more complete for software development On the one hand, the method becomes more concrete with solutions that help e ffectively apply the method in OOPL platforms On the other hand, the method is more complete with solutions for the design aspects that were not originally included Tóm tắt Trong vịng hai thập kỷ gần đây, phương pháp luận phát triển phần mềm dựa mơ hình lên phương pháp luận quan trọng kỹ nghệ phần mềm Ở trung tâm phương pháp luận có hai phương pháp có tính bổ trợ là: kỹ nghệ phần mềm hướng mơ hình (model-driven software engineering (MDSE)) thiết kế hướng miền (domain-driven design (DDD)) Trong MDSE mang mục tiêu rộng tham vọng mục tiêu DDD lại khiêm tốn thực tế hơn, tập trung vào cách áp dụng kỹ thuật kỹ nghệ dựa mơ hình để giải phức tạp vốn có yêu cầu miền Phương pháp DDD bao gồm tập ngun lý để xây dựng mơ hình miền dạng khả thi cho triển khai viết mã ngơn ngữ lập trình đích Tuy nhiên phương pháp thiếu giải pháp cần thiết giúp giải đáp hai câu hỏi quan trọng mà người phát triển phần mềm thường gặp phải áp dụng DDD vào tảng ngơn ngữ lập trình hướng đối tượng (object oriented programming language (OOPL)): (i) thành phần cấu tạo nên mơ hình miền có mức độ diễn đạt thiết yếu? (ii) xây dựng cách hiệu phần mềm từ mơ hình miền nào? Luận án đặt mục đích khắc phục hạn chế DDD cách sử dụng ngôn ngữ chuyên biệt miền dựa ghi (annotation-based domain-specific language (aDSL)), phát triển OOPL, để không biểu diễn mơ hình miền hợp thiết yếu mà cịn để xây dựng phần mềm có tính mơ-đun từ mơ hình miền Thứ nhất, luận án đề xuất aDSL, tên ngôn ngữ đặc tả lớp miền (domain class specification language (DCSL)), bao gồm tập ghi để biểu diễn ràng buộc cấu trúc thiết yếu hành vi thiết yếu lớp miền Tác giả cẩn thận lựa chọn đặc trưng thiết kế từ số nguồn tài liệu học thuật có uy tín else result = a name + ’ = ’+ a name + ’ @pre - > asSet () -> union ( Set { ’+ m name + ’}) ’ 49 endif 51 context ExprTk :: g e n L i n k A d d e r P o s t C o n d ( c : Classifier , a : Field ) : String return post - co nd it io n (2) for a link - remover op er at io n de pe nd in g on m type pre : a type o c l I s K i n d O f ( C o l l e c t i o n T y p e ) post : result = g e n L i n k R e m o v e r P o s t C o n d (c , a ) Tk Figure A.2: Utility class Tk context Tk :: isLinkTo ( o1 : Object , a : Field , o2 : Object ) : Boolean check if a value ( o1 ) contains a link to o2 post : let v1 = a value ( o1 ) in if a type o c l I s K i n d O f ( C o l l e c t i o n T y p e ) then v1 - > includes ( o2 ) else v1 = o2 endif context Tk :: an ce st or s ( c : Class ) : Set ( Class ) return ancestor classes of c post : if not ( c gens o c l I s U n d e f i n e d () ) then 11 result = c gens - > collect ( g | { g super } union ( a nc es to rs ( g super ) ) -> e xc lu di ng ( OclVoid ) ) -> flatten () -> asSet () else result = OclVoid endif 160 Classifier context C l a s s i f i e r if this conforms to C o l l e c t i o n T y p e then return e l e m e n t T y p e else return self def : e l e m e n t T y p e () : C l a s s i f i e r = if o c l I s K i n d O f ( C o l l e c t i o n T y p e ) then oc lA sT yp e ( C o l l e c t i o n T y p e ) e l e m e n t T y p e else self endif Class context Class return all link - remover methods of this def : l i n k R e m o v e r s () : Set ( Method ) = methods - > select ( m | m opt type = OptType :: L i n k R e m o v e r ) return all link - adder methods of this def : l i n k A d d e r s () : Set ( Method ) = methods - > select ( m | m opt type = OptType :: Li nk Ad de r ) return all ov er ri de n methods of this def : o v e r r i d e n M e t h o d s () : Set ( Method ) = methods - > select ( m | m annotations - > select ( n | n name = ’ Overriden ’) -> size () = 1) Method context Method return the post - co nd it io n exprs of a method def : postExps () : Sequence ( O c l E x p r e s s i o n ) = post s p e c i f i c a t i o n oc lA sT yp e ( O p a q u e E x p r e s s i o n ) body oc lA sT yp e ( Sequence ( O c l E x p r e s s i o n ) ) return the pre - co nd it io n exprs of a method def : preExps () : Sequence ( O c l E x p r e s s i o n ) = pre s p e c i f i c a t i o n oc lA sT yp e ( O p a q u e E x p r e s s i o n ) body oc lA sT yp e ( Sequence ( O c l E x p r e s s i o n ) ) 11 return the result expression def : re su lt Ex p () : O c l E x p r e s s i o n = if postExps () -> size () = and of the 12 161 form " result = " postExps () -> any ( true ) o cl Is Ty pe ( V a r A s s i g n E x p r e s s i o n ) then postExps () -> any ( true ) o cl As Ty pe ( V a r A s s i g n E x p r e s s i o n ) else OclVoid endif 20 21 is this an ov er ri de n method def : i s O v e r r i d e n () : Boolean = ( annotations - > select ( n | n name = ’ Overriden ’) -> size () = 1) 24 is this the mutator method def : is At tr Re f ( a : Field ) : Boolean = ( ref value = a name ) 27 is this a creator method or a mutator method def : i s C r e a t o r O r M u t a t o r R e f ( a : Field ) : Boolean = i s C r e a t o r R e f ( a ) or i s M u t a t o r R e f ( a ) 28 that references a? 31 is this a creator method that contains a pa me te r def : i s C r e a t o r R e f ( a : Field ) : Boolean = is Cr ea to r () and params - > exists ( i sA tt rR ef ( a ) ) 32 referencing a? 35 is this a mutator method that contains a pa me te r def : i s M u t a t o r R e f ( a : Field ) : Boolean = is Mu ta to r () and params - > exists ( i sA tt rR ef ( a ) ) ) 36 39 is this the creator method def : is Cr ea to r () : Boolean = ( opt type = OptType :: Creator ) 42 is this the mutator method def : is Mu ta to r () : Boolean = ( opt type = OptType :: Mutator ) Parameter context Pa me te r does this re fe re nc e a ? def : is At tr Re f ( a : Field ) : Boolean = ( ref value = a name ) Field context f : Field de te rm in e if a field has numeric 162 type referencing a? def : i s N u m e r i c T y p e () : Boolean = let tyn : String = f type name in tyn = ’ Integer ’ or tyn = ’ Real ’ or tyn = ’ UnlimitedNatural ’ DAttr context DAttr does this preserve another DAttr ? def : pr es er ve s ( r : DAttr ) : Boolean = mutable = r mutable and optional = r optional and unique = r unique and id = r id and auto = r auto and length = r and max Double :: INFINITY implies max collect ( f | MCCModel :: g e t I n s t a n c e () :: l o o k U p M o d u l e C f g ( f type ) ) -> asSet () in 11 G union (G - > iterate ( g ; G1 : Set ( Set ( M o d u l e C o n f i g ) ) = Set {}) | G1 - > i nc lu di ng ( descMods ( g ) ) ) -> flatten () else {} endif 16 if g is co mp os it e then return the M o d u l e C o n f i g s of the d e s c e n d a n t modules else return {} def : descMods ( g : M o d u l e C o n f i g ) : Set ( M o d u l e C o n f i g ) = if g i s C o m p o s i t e () then 164 g descMods () else {} endif 25 return the M o d u l e C o n f i g of the descendant in t whose domain class is mapped to n def : g e t D e s c M o d u l e O f ( n : Node ) : M o d u l e C o n f i g = descMods () -> select ( model d o m a i n C l a s s = n dclass ) -> any () module of this 26 30 if this is a co mp os it e module return true else return false def : i s C o m p o s i t e () : Boolean = model d o m a i n C l a s s assocFields - > notEmpty () 31 Class R 29 context Class if self contains domain fields then return def : mF ie ld s () : Set ( Field ) = fields - > select ( f | not ( f atr o c l I s U n d e f i n e d () ) ) them as Set else return if self contains a domain field whose name is n then return it else return OclVoid def : g e t D o m F i e l d ( n : String ) : Field = let F : Set ( Field ) = fields - > select ( f | not ( f atr o c l I s U n d e f i n e d () ) and f name = n ) in if F - > notEmpty () then F - > any () else OclVoid endif 11 12 13 14 if self contains a s s o c i a t i v e domain fields then else return {} def : a s s o c F i e l d s () : Set ( Field ) = fields - > select ( f | not ( f atr o c l I s U n d e f i n e d () ) and o c l I s U n d e f i n e d () ) ) return them as Set not ( f asc 15 16 whether or not self 17 def : i s D o m a i n C l a s s () : Boolean = not ( dcl o c l I s U n d e f i n e d () ) is a domain class ( i e is 165 defined with DClass ) {} Containment Tree R 30 context Tree d e t e r m i n e s if there is a path ( i e a sequence of connect n1 to n2 ( in either di re ct io n ) def : hasPath ( n1 : Node , n2 : Node ) : Boolean = edges - > exists (( parent = n1 and child = n2 ) or ( parent )) edges ) that = n2 and child = n1 or nodes - > exists ( n3 | hasPath ( n1 , n3 ) and hasPath ( n3 , n2 ) ) R 31 context Tree return set of pairs ( n : Node , s : String ) such that n is the root or a child node and s is the c o n t a i n m e n t scope string of n edge or of the S c o p e C o n f i g of the Edge in which n is the child def : g e t C o n t S c o p e s () : Set ( Tuple ( n : Node , s : String ) ) = let C : Set ( Tuple ( n : Node , s : String ) ) = edges - > select ( e | not ( e scope s t a t e S c o p e o c l I s U n d e f i n e d () ) ) -> collect ( e | Tuple { n = e child , s = e scope s t a t e S c o p e } ) -> asSet () in if not ( root s t a t e S c o p e o c l I s U n d e f i n e d () ) then 12 { Tuple { n = root , s = root s t a t e S c o p e else C endif } union ( C ) Tk R 32 context Tk :: p a r s e C o n t S c o p e ( s : String ) : Set ( String ) if s contains ‘,’ then split s into elements ( using ‘,’ as se pa to r ) and return them as Set , else return { s } pre : s indexOf ( ‘ , ’) > implies s size () >= post : result = splitStr (s , ‘ , ’) 166 R 33 context Tk :: splitStr ( s : String , p : String ) : Set ( String ) if s contains p then split s into elements ( using p as and return them as Set , else return { s } pre : p size () = and ( s indexOf ( p ) > implies s size () se pa to r ) >= 3) post : let i : Integer = s indexOf ( p ) in if i > then result = splitStr ( s su bs tr in g (0 , i -1) , p ) union ( 10 splitStr ( s s ub st ri ng ( i +1 , s size () ) ,p ) ) else result = { s } endif MCCModel In the next OCL rule, we assume the existence of the attribute MCCModel.mcfgs whose type is Set(ModuleConfig) This attribute records all the ModuleConfigs of all the software modules R 34 context MCCModel return the M o d u l e C o n f i g of the owner module def : l o o k U p M o d u l e C o n f i g ( c : Class ) : M o d u l e C o n f i g = mcfgs - > select ( model d o m a i n C l a s s = c ) -> any () of c B.2 Two MCCs of ModuleEnrolmentMgmt Listing B.1: The MCC of ModuleEnrolmentMgmt with containment tree @ModuleDesc( name = " M o d u l e E n r o l m e n t M g m t " , mo de l De sc = @ M od el De sc ( model = E n r o l m e n t M g m t class ) , viewDesc = @ ViewDesc ( f or mT it le = " Manage E nr ol me nt M a n a g e m e n t " , i ma ge Ic on = " e nr ol me nt jpg " , d o m a i n C l a s s L a b e l = " En ro lm en t M a n a g e m e n t " , view = View class , p a r e n t M e n u = R e g i o n N a m e Tools , topX =0.5 , topY =0.0) , c o n t r o l l e r D e s c = @ C o n t r o l l e r D e s c ( c o n t r o l l e r = C o n t r o l l e r class ) , c o n t a i n m e n t T r e e = @CTree ( root = E n r o l m e n t M g m t class , 167 edges ={ // e n r o l m e n t m g m t -> student @CEdge ( parent = E n r o l m e n t M g m t class , child = Student class , sc op eD es c = @ S co pe De sc ( 13 s t a t e S c o p e ={ " id " , " name " , " h e l p R e q u e s t e d " , " modules " } )) }) ) public class M o d u l e E n r o l m e n t M g m t { 17 @ A t t r i b u t e D e s c ( label = " E nr ol me nt Management") private String title ; 19 // student r e g i s t r a t i o n @ A t t r i b u t e D e s c ( label = " Student R e g i s t r a t i o n " , l a y o u t B u i l d e r T y p e = T w o C o l u m n L a y o u t B u i l d e r class ,controllerDesc=@ControllerDesc( openPolicy=OpenPolicy.I // support many - many a s s o c i a t i o n with C o u r s e M o d u l e , props ={ 27 // custom Create : to create { @link En ro lm en t } from 21 the course modules @ P r o p e r t y D e s c ( name = P r o p e r t y N a m e c o n t r o l l e r _ d a t a C o n t r o l l e r _ c r e a t e , v a l u e I s C l a s s = C r e a t e O b j e c t A n d M a n y A s s o c i a t e s D a t a C o n t r o l l e r C o m m a n d class , v a l u e A s S t r i n g = M e t a C o n s t a n t s NullValue , v al ue Ty pe = Class class ) , // custom Update command : to update { @link En ro lm en t } from the course modules @ P r o p e r t y D e s c ( name = P r o p e r t y N a m e c o n t r o l l e r _ d a t a C o n t r o l l e r _ u p d a t e , v a l u e I s C l a s s = U p d a t e O b j e c t A n d M a n y A s s o c i a t e s D a t a C o n t r o l l e r C o m m a n d class , v a l u e A s S t r i n g = M e t a C o n s t a n t s NullValue , v al ue Ty pe = Class class ) }) ) private Collection < Student > students ; 38 // help desk @ A t t r i b u t e D e s c ( label = " Help private Collection < HelpRequest > he lp De sk s ; 40 Request " , type = D e f a u l t P a n e l class ) 42 // class r e g i s t r a t i o n 44 @ A t t r i b u t e D e s c ( label = " Class R e g i s t r a t i o n " , type = D e f a u l t P a n e l class ) 45 private Collection < SC la ss Re gi st ti on > s c l a s s R e g i s t s ; } 168 Listing B.2: The MCC of ModuleEnrolmentMgmt with custom subview configuration for a descendant module of type ModuleStudent @ModuleDesc( name = " M o d u l e E n r o l m e n t M g m t " , mo de l De sc = @ M od el De sc ( model = E n r o l m e n t M g m t class ) , viewDesc = @ ViewDesc ( f or mT it le = " Manage E nr ol me nt M a n a g e m e n t " , i ma ge Ic on = " e nr ol me nt jpg " , d o m a i n C l a s s L a b e l = " En ro lm en t M a n a g e m e n t " , view = View class , p a r e n t M e n u = R e g i o n N a m e Tools , topX =0.5 , topY =0.0) , c o n t r o l l e r D e s c = @ C o n t r o l l e r D e s c ( c o n t r o l l e r = C o n t r o l l e r class ) , c o n t a i n m e n t T r e e = @CTree ( root = E n r o l m e n t M g m t class , edges ={ // e n r o l m e n t m g m t -> student 11 @CEdge ( parent = E n r o l m e n t M g m t class , child = Student class , sc op eD es c = @ S co pe De sc ( 13 s t a t e S c o p e ={ " id " , " name " , " h e l p R e q u e s t e d " , " modules " } // custom c o n f i g u r a t i o n for M o d u l e S t u d e n t , a t t r i b D e s c s ={ // Student name is not editable 17 @ A t t r i b u t e D e s c ( id = " id " , type = J L a b e l F i e l d class ) , 18 @ A t t r i b u t e D e s c ( id = " name " , type = J L a b e l F i e l d class , editable = false ) , }) )} ) ) public class M o d u l e E n r o l m e n t M g m t { 23 @ A t t r i b u t e D e s c ( label = " E nr ol me nt private String title ; Management") 25 // student r e g i s t r a t i o n 27 @ A t t r i b u t e D e s c ( label = " Student R e g i s t r a t i o n " , l a y o u t B u i l d e r T y p e = T w o C o l u m n L a y o u t B u i l d e r class ,controllerDesc=@ControllerDesc( openPolicy=OpenPolicy.I // support many - many a s s o c i a t i o n with C o u r s e M o d u l e , props ={ 33 // custom Create : to create { @link En ro lm en t } from the course modules @ P r o p e r t y D e s c ( name = P r o p e r t y N a m e c o n t r o l l e r _ d a t a C o n t r o l l e r _ c r e a t e , v a l u e I s C l a s s = C r e a t e O b j e c t A n d M a n y A s s o c i a t e s D a t a C o n t r o l l e r C o m m a n d class 36 , v a l u e A s S t r i n g = M e t a C o n s t a n t s NullValue , v al ue Ty pe = Class class ) , // custom Update : to update { @link En ro lm en t } from the course modules @ P r o p e r t y D e s c ( name = P r o p e r t y N a m e c o n t r o l l e r _ d a t a C o n t r o l l e r _ u p d a t e , v a l u e I s C l a s s = U p d a t e O b j e c t A n d M a n y A s s o c i a t e s D a t a C o n t r o l l e r C o m m a n d class , v a l u e A s S t r i n g = M e t a C o n s t a n t s NullValue , v al ue Ty pe = Class class ) 169 }) ) private Collection < Student > students ; 42 // help desk @ A t t r i b u t e D e s c ( label = " Help private Collection < HelpRequest > he lp De sk s ; 44 Request " , type = D e f a u l t P a n e l class ) 46 // class r e g i s t r a t i o n 48 @ A t t r i b u t e D e s c ( label = " Class R e g i s t r a t i o n " , type = D e f a u l t P a n e l class ) 49 private Collection < SC la ss Re gi st ti on > s c l a s s R e g i s t s ; } 170 Appendix C DCSL Evaluation Data C.1 Expressiveness Comparison Between DCSL and the DDD Frameworks Table C.1: Comparing the expressiveness of DCSL to AL, XL DCSL AL XL mutable DomainObject.editing – – (i) Required DClass DAttr unique optional (ii) jdo Column.allowsNull, (Property.optionality) mutable id auto length Property.editing jdo.PrimaryKey.value – jdo.Column.length, (Property.maxLength) – Min value max – Max value DAssoc 171 jpa.Id – (iii) jpa (iv) Column.length (v) (v) ascName ascType – – – jpa.OneToMany, jpa.ManyToOne, jpa.ManyToMany role – – endType – – associate.type – – associate.cardMin – – associate.cardMax – – DOpt type – – requires – – effects – – AttrRef value – – (i) AL supports property Property.mustSatisfy which may be used to implement the constraint (ii) Java Data Objects (JDO) [18] (iii) XL supports property ha.Formula that may be use to implement formula for value generation function (iv) Java Persistence API (JPA) [59] (v) Bean Validator (BV) [63] 172 C.2 Level of Coding Comparison Between DCSL and the DDD Frameworks Table C.2: Comparing the max-locs of DCSL to AL, XL DCSL Domain Class DClass.mutable AL XL DomainObject.editing, autoCompleteRepository Entity, EntityValidator.value DAttr.length, min, max Column.allowsNull, name, one-of { length, scale }, jdbcType Required, one-of { Column.length, scale }, PropertyValidator.value, Min.value, Max.value, SearchKey Associative Field DAssoc.ascName, ascType, role, endType; associate.type, associate.cardMin, associate.cardMax – Domain Field one-of { OneToMany, 173 ManyToOne, ManyToMany} Table C.3: Comparing the typical-locs of DCSL to AL, XL DCSL Domain Class DClass.mutable Domain Field one-of { DAttr.length, min, max } Associative Field DAssoc.ascName, ascType, role, endType; associate.type, associate.cardMin, associate.cardMax AL XL DomainObject.editing, autoCompleteRepository Entity, EntityValidator.value one-of { Column.length, one-of { Column.length, Column.scale, Min.value, Max.value } scale } one-of { OneToMany, – 174 ManyToOne, ManyToMany} ... general approaches to defining the SDM of a language The first approach is denotational, which uses a mathematics-based formalism The second approach is translational, which translates the language... of taking the object-relational mapping and applying it to the domain model In particular, it handles how an entity is stored in an underlying database and how to manage access to this database... run-time state when a mogram is executed As a general modelling approach, there are a variety of meta-modelling languages that can be applied A de facto language is Unifield Modelling Language (UML)

Ngày đăng: 07/08/2020, 07:44

Từ khóa liên quan

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan