CN101533349B - Platform-related model of large-granularity components and method of automatic code generation thereof - Google Patents
Platform-related model of large-granularity components and method of automatic code generation thereof Download PDFInfo
- Publication number
- CN101533349B CN101533349B CN2009100717795A CN200910071779A CN101533349B CN 101533349 B CN101533349 B CN 101533349B CN 2009100717795 A CN2009100717795 A CN 2009100717795A CN 200910071779 A CN200910071779 A CN 200910071779A CN 101533349 B CN101533349 B CN 101533349B
- Authority
- CN
- China
- Prior art keywords
- business
- component
- model
- components
- software
- 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
- 238000000034 method Methods 0.000 title claims abstract description 48
- 238000011161 development Methods 0.000 claims description 22
- 230000008569 process Effects 0.000 claims description 13
- 230000006870 function Effects 0.000 claims description 12
- 230000001419 dependent effect Effects 0.000 claims description 10
- 230000006978 adaptation Effects 0.000 claims description 3
- 230000001172 regenerating effect Effects 0.000 claims description 3
- 230000000694 effects Effects 0.000 claims description 2
- 238000004519 manufacturing process Methods 0.000 claims description 2
- 238000013459 approach Methods 0.000 claims 3
- 238000012800 visualization Methods 0.000 claims 2
- 230000009897 systematic effect Effects 0.000 abstract description 3
- 230000007547 defect Effects 0.000 abstract description 2
- 230000018109 developmental process Effects 0.000 description 31
- 238000006243 chemical reaction Methods 0.000 description 13
- 238000013461 design Methods 0.000 description 6
- 238000005516 engineering process Methods 0.000 description 6
- 230000007246 mechanism Effects 0.000 description 6
- 230000003068 static effect Effects 0.000 description 5
- 238000010586 diagram Methods 0.000 description 4
- 230000008859 change Effects 0.000 description 3
- 238000013507 mapping Methods 0.000 description 3
- 238000004590 computer program Methods 0.000 description 2
- 230000010354 integration Effects 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 238000011160 research Methods 0.000 description 2
- 230000009466 transformation Effects 0.000 description 2
- 230000000007 visual effect Effects 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 1
- 239000000470 constituent Substances 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 239000012634 fragment Substances 0.000 description 1
- 230000007774 longterm Effects 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 238000000059 patterning Methods 0.000 description 1
- 238000007639 printing Methods 0.000 description 1
- 238000007634 remodeling Methods 0.000 description 1
- 238000012827 research and development Methods 0.000 description 1
- 238000000926 separation method Methods 0.000 description 1
- 230000033772 system development Effects 0.000 description 1
Images
Landscapes
- Stored Programmes (AREA)
Abstract
一种大粒度构件的平台相关模型的代码自动生成方法,本发明涉及模型驱动的企业应用软件开发方法。它解决目前缺乏一种系统性具体化的大粒度业务构件的建模方法和现有技术生成的软件缺乏灵活性和可变性的缺陷。它通过下述步骤实现:从已有的、企业业务内容相同的多个软件中,各抽象出多个业务构件的典型软件模式,并获取基于模式的非实例化构件文本;从获取的业务构件的典型软件模式中选定软件模式,基于特定软件模式建立业务构件的平台相关模型;将业务构件的平台相关模型自动生成为干业务构件程序;将干业务构件面向特定需求实例化为复用业务构件程序,产生最终的源程序代码;在最终的软件系统中业务构件通过解析配置文件来动态适应企业的业务需求。
The invention relates to a method for automatically generating codes of a platform-related model of a large-grained component, and the invention relates to a model-driven enterprise application software development method. It solves the defects of the current lack of a systematic and specific large-grained business component modeling method and the lack of flexibility and variability of software generated by the prior art. It is realized through the following steps: abstract the typical software patterns of multiple business components from the existing software with the same business content, and obtain the non-instantiated component text based on the pattern; from the obtained business components Select the software model from the typical software model, and establish the platform-related model of the business component based on the specific software model; automatically generate the platform-related model of the business component into a dry business component program; instantiate the dry business component into a reusable business for specific requirements The component program generates the final source program code; in the final software system, the business component dynamically adapts to the business needs of the enterprise by parsing the configuration file.
Description
技术领域 technical field
本发明涉及模型驱动的企业应用软件开发方法,尤其涉及一种基于大粒度构件平台相关模型的软件开发方法,属于信息技术领域。The invention relates to a model-driven enterprise application software development method, in particular to a software development method based on a large-grained component platform-related model, which belongs to the field of information technology.
背景技术 Background technique
面对全球范围内激烈的市场竞争,企业总是持续完善其业务模式以提高其自身的竞争力,企业管理软件也必须能够快速有效地适应不断变化的业务需求。然而当前的企业应用软件存在研发成本高、实施成本高、实施周期长等问题,严重阻碍了快速低成本地开发具有随需应变能力的构件化软件系统。In the face of fierce market competition around the world, enterprises always continue to improve their business models to enhance their own competitiveness, and enterprise management software must also be able to quickly and effectively adapt to changing business needs. However, the current enterprise application software has problems such as high research and development costs, high implementation costs, and long implementation cycles, which seriously hinder the rapid and low-cost development of componentized software systems with on-demand capabilities.
模型驱动的软件体系结构(Model Driven Architecture,MDA)与软件开发被认为是开发此类软件的一种有效途径。MDA的目标是通过关注点的结构性分离来实现复杂抽象系统不同层面的可实施性、互操作性和可重用性,将大型软件系统的开发分解为不同层面、分而治之,降低了系统整体设计和开发的难度,有效地提高了复杂系统开发的成功性。MDA的基本思想是将系统的需求、功能规约与其在特定技术平台上的实现规约相分离,分别建立描述业务需求的计算无关模型、描述软件系统设计方案的平台无关模型和描述具体实现机制的平台相关模型(Platform Specific Model,PSM),通过各层次模型要素的映射和转换实现逐层精化以及软件系统自动生成,其中建模与模型转换是MDA研究的两个核心问题。平台相关模型PSM向上需要承接软件设计内容并将其转换为特定运行平台上的系统实现模型,向下它是模型转换与自动生成代码的基础,其正确性与优化程度决定了软件的性能。Model-driven software architecture (Model Driven Architecture, MDA) and software development are considered to be an effective way to develop such software. The goal of MDA is to achieve the implementability, interoperability and reusability of different levels of complex abstract systems through the structural separation of concerns, decompose the development of large software systems into different levels, divide and conquer, and reduce the overall system design. The difficulty of development effectively improves the success of complex system development. The basic idea of MDA is to separate the requirements and function specifications of the system from their implementation specifications on a specific technology platform, and respectively establish a computing-independent model describing business requirements, a platform-independent model describing software system design schemes, and a platform describing specific implementation mechanisms. The relevant model (Platform Specific Model, PSM) realizes layer-by-layer refinement and automatic generation of software systems through the mapping and conversion of model elements at each level. Modeling and model conversion are the two core issues of MDA research. The platform-dependent model PSM needs to undertake software design content and convert it into a system implementation model on a specific operating platform. Downward, it is the basis for model conversion and automatic code generation. Its correctness and optimization degree determine the performance of the software.
模型驱动的软件开发只有在代码生成技术相对成熟的基础上才能真正得以实现。代码生成器的主旨是利用计算机程序来编写计算机程序,代码生成是提高软件开发效率的有效手段之一。最初的用途是从高级语言编译后生成汇编代码、机器指令,是语言转换、编译的不可缺少的工具。代码生成研究一直关注于代码编译,早期的基于Graham-Glanville方法的代码生成器来替换C语言编译器,通过构造一种描述目标代码的表格经过模式匹配输出生成的代码。之后代码生成技术被引入基于高级语言的软件开发领域,支持由可视化模型生成可执行代码。代码生成类型可以归为下列形式:代码重塑、内联代码展开、混合代码生成、局部类生成、层次化生成、全领域语言描述等。随着模型驱动体系结构技术的发展,代码生成技术被广泛应用于企业应用软件的开发,支持从平台相关模型到可执行代码的自动转换。其中,通过模式化构件共性以提高其抽象度和复用度,采用基于模式的代码生成方法可以有效提高PSM模型到代码的转换效率和正确性。在长期的软件开发与应用过程中,人们抽象出多种软件模式,如软件架构中的Client/Server模式、多层结构模式、MVC、管道过滤器等;软件开发划分为基于概念模式规约的问题域,基于设计模式的设计域和实现概念模式的解空间,采用设计模式指导概念模型到服务程序的生成;或建立基于XML模式的柔性代码生成器以生成分布式系统;或基于XSLT和Velocity模板引擎实现业务模型到程序的转换。Model-driven software development can only be realized on the basis of relatively mature code generation technology. The purpose of the code generator is to use computer programs to write computer programs, and code generation is one of the effective means to improve the efficiency of software development. The original purpose is to generate assembly code and machine instructions after compiling from a high-level language, and it is an indispensable tool for language conversion and compilation. Code generation research has always focused on code compilation. The early code generator based on the Graham-Glanville method replaced the C language compiler, and output the generated code through pattern matching by constructing a table describing the target code. Later, code generation technology was introduced into the field of software development based on high-level languages, supporting the generation of executable code from visual models. The types of code generation can be classified into the following forms: code remodeling, inline code expansion, mixed code generation, partial class generation, hierarchical generation, and domain-wide language description. With the development of model-driven architecture technology, code generation technology is widely used in the development of enterprise application software, which supports automatic conversion from platform-dependent models to executable code. Among them, by patterning the commonality of components to improve their abstraction and reusability, the code generation method based on patterns can effectively improve the conversion efficiency and correctness of PSM models to codes. In the long-term software development and application process, people have abstracted a variety of software patterns, such as Client/Server pattern in software architecture, multi-layer structure pattern, MVC, pipeline filter, etc.; software development is divided into issues based on conceptual model specification Domain, based on the design domain of the design pattern and the solution space to realize the conceptual pattern, use the design pattern to guide the generation of the conceptual model to the service program; or establish a flexible code generator based on XML schema to generate a distributed system; or based on XSLT and Velocity template The engine implements the transformation from business model to program.
虽然,MDA思想改变了传统的软件开发进程,将软件开发者从繁杂的编程中解放出来,提升为以模型为中心,进行模型构造、转换和精化,并通过代码自动生成来开发系统。但是尚缺乏一种系统性具体化的企业应用软件建模方法,来指导具体的软件开发。并且已有的代码生成方案和工具也存在扩展性和可集成性差的不足。大多数代码生成器生成的程序缺乏灵活性,一旦生成代码,用户难以改变其结构和风格。生成工具难于广泛使用,导致用户需要根据自己的模型,设计开发特定的代码生成工具。Although, the MDA idea has changed the traditional software development process, liberated software developers from complicated programming, promoted it to be model-centered, carried out model construction, transformation and refinement, and developed the system through automatic code generation. However, there is still a lack of a systematic and specific enterprise application software modeling method to guide specific software development. Moreover, the existing code generation schemes and tools also have the disadvantages of poor scalability and integration. The programs generated by most code generators lack flexibility. Once the code is generated, it is difficult for users to change its structure and style. Generation tools are difficult to be widely used, leading users to design and develop specific code generation tools according to their own models.
发明内容 Contents of the invention
本发明的目的是提供一种大粒度构件的平台相关模型的代码自动生成方法,以解决目前缺乏一种系统性具体化的企业应用软件建模方法和现有技术生成的软件缺乏灵活性和可变性的缺陷。它通过下述步骤实现:一、从已有的、企业业务内容相同的多个软件中,各抽象出多个业务构件的典型软件模式,并获取基于模式的非实例化构件文本;二、建模阶段:从步骤一获取的多个业务构件的典型软件模式中选定软件模式,从而获取业务构件的平台相关模型;三、开发阶段:将业务构件的平台相关模型自动生成为干业务构件程序;四、部署阶段:将干业务构件面向特定需求实例化为复用业务构件程序,从而产生最终的源程序代码;在最终的软件系统中复用业务构件通过解析配置文件来动态适应企业的业务需求。存在三种途径来适应企业的变化性需求:途径之一,当业务变化体现权限或个性化的相关需求时,通过动态配置的方式调整部署配置文件或个性化配置文件信息以实现对业务构件的复用和软件功能的调整。途径之二,当业务变化不能通过动态配置方式予以满足时,可部分修改构件程序实现对业务构件的适配和复用。途径之三,当业务变化显著,上述两种途径均不适用时,可通过重新建立大粒度构件模型再生成为新业务构件的方式满足新的软件业务需求;The purpose of the present invention is to provide a method for automatic code generation of a platform-dependent model of a large-grained component to solve the lack of a systematic and specific enterprise application software modeling method and the lack of flexibility and reliability of the software generated by the prior art. Transgender flaws. It is realized through the following steps: 1. Abstract the typical software patterns of multiple business components from the existing software with the same business content, and obtain the non-instantiated component text based on the pattern; 2. Build Modeling stage: select the software pattern from the typical software patterns of multiple business components obtained in step 1, so as to obtain the platform-related model of the business component; 3. Development stage: automatically generate the platform-related model of the business component into a dry business component program ; 4. Deployment stage: Instantiate the dry business component into a reused business component program for specific requirements, thereby generating the final source program code; in the final software system, the reused business component dynamically adapts to the business of the enterprise by parsing the configuration file need. There are three ways to adapt to the changing needs of the enterprise: one way, when the business changes reflect the related needs of permissions or personalization, adjust the deployment configuration file or personalization configuration file information through dynamic configuration to realize the business components. Reuse and adjustment of software functions. The second way is that when the business change cannot be satisfied by dynamic configuration, the component program can be partially modified to realize the adaptation and reuse of the business component. The third way, when the business changes significantly and the above two ways are not applicable, the new software business needs can be met by re-establishing the large-grained component model and regenerating it into a new business component;
业务构件模型在开发与部署过程中被分阶段地多重生成为干业务构件和复用业务构件;在开发阶段将上述模型输入代码生成器,将与其匹配模式的非实例化构件实例化为与模型描述一致的干业务构件可执行程序;在部署阶段,系统自动部署工具读取部署需求将干业务构件派生为多个实例构件。The business component model is multi-generated into dry business components and reused business components in stages during the development and deployment process; in the development phase, the above model is input into the code generator, and the non-instantiated components that match the pattern are instantiated into the model Describe the executable program of the consistent dry business component; in the deployment phase, the system automatic deployment tool reads the deployment requirements and derives the dry business component into multiple instance components.
基于本方法生成的软件系统具有适应企业业务需求不断变化的能力,存在三种途径来适应企业的变化性需求:途径之一,当业务变化体现权限或个性化的相关需求时,通过动态配置的方式调整部署配置文件或个性化配置文件信息以实现对业务构件的复用和软件功能的调整。途径之二,当业务变化不能通过动态配置方式予以满足时,可部分修改构件程序实现对业务构件的适配和复用。途径之三,当业务变化较大,上述两种途径均不适用时,可通过重新建立大粒度构件模型再生成为新业务构件的方式满足新的软件业务需求。由此解决了现有技术生成的程序缺乏灵活性和可变性的缺陷。本发明将软件的适应性分解到多个阶段予以实现,确保了高效快速的构件化开发和复用。The software system generated based on this method has the ability to adapt to the ever-changing business needs of the enterprise. There are three ways to adapt to the changing needs of the enterprise: one way, when the business changes reflect the relevant needs of authority or individualization, through dynamic configuration Adjust deployment configuration file or personalization configuration file information to achieve reuse of business components and adjustment of software functions. The second way is that when the business change cannot be satisfied by dynamic configuration, the component program can be partially modified to realize the adaptation and reuse of the business component. The third way is that when the business changes greatly and the above two ways are not applicable, the new software business needs can be met by re-establishing the large-grained component model and regenerating it into a new business component. Therefore, the defects of lack of flexibility and variability of programs generated by the prior art are solved. The invention decomposes the adaptability of software into multiple stages for realization, ensuring efficient and rapid component development and reuse.
附图说明 Description of drawings
图1为本发明的流程图;图2为本发明的业务构件软件模式结构树的示意图;图3为本发明大粒度业务构件的平台相关模型示意图;图4为本发明基于模式的大粒度构件代码生成器工作原理图;图5为本发明的一个实施例的实现方案图。Fig. 1 is a flowchart of the present invention; Fig. 2 is a schematic diagram of a business component software model structure tree of the present invention; Fig. 3 is a schematic diagram of a platform-related model of a large-grained business component of the present invention; Fig. 4 is a pattern-based large-grained component of the present invention Working principle diagram of the code generator; FIG. 5 is an implementation diagram of an embodiment of the present invention.
具体实施方式 Detailed ways
具体实施方式一:下面结合图1具体说明本实施方式。本实施方式由下述步骤实现:一、从已有的、企业业务内容相同的多个软件中,各抽象出若干个业务构件的典型软件模式,并获取基于模式的非实例化构件文本;二、建模阶段:从步骤一获取的多个业务构件的典型软件模式中选定软件模式,从而获取业务构件的平台相关模型;三、开发阶段:将业务构件的平台相关模型自动生成为干业务构件程序;四、部署阶段:将干业务构件面向特定需求实例化为复用业务构件程序,从而产生最终的源程序代码;在最终的软件系统中复用业务构件通过解析配置文件来动态适应企业的业务需求。Specific Embodiment 1: The present embodiment will be specifically described below with reference to FIG. 1 . This embodiment is realized by the following steps: 1. Abstract the typical software patterns of several business components from the existing multiple software with the same business content, and obtain the non-instantiated component text based on the pattern; 2. 1. Modeling stage: Select the software model from the typical software models of multiple business components obtained in step 1, so as to obtain the platform-related model of the business component; 3. Development stage: Automatically generate the platform-related model of the business component as a dry business Component program; 4. Deployment stage: Instantiate the dry business component into a reused business component program for specific requirements, thereby generating the final source program code; reuse the business component in the final software system to dynamically adapt to the enterprise by parsing the configuration file business needs.
下面详细描述本实施方式中业务构件的产生、特征与分类方法:The generation, characteristics and classification methods of business components in this embodiment are described in detail below:
(1)通过对既有企业应用软件的分析,归纳出一种以业务单据数据为属性集,围绕单据的处理为操作集的模式化大粒度构件。模式化大粒度构件是相对小粒度构件而言的,小粒度构件是指在应用软件中可被明确识别的、不可再细分的基本构成要素,如文本框、下拉列表框和单选按钮等基本控件,它具有业务无关性。由若干小粒度构件和其间的关联过程,按照用户的需求组装成一个具有业务语义完整性的构件,称其为业务构件(Business Component)。(1) Through the analysis of the existing enterprise application software, a kind of large-grained modular component with business document data as the attribute set and document processing as the operation set is summarized. Patterned large-grained components are relative to small-grained components, which refer to basic elements that can be clearly identified in application software and cannot be subdivided, such as text boxes, drop-down list boxes, and radio buttons. Basic controls, which are business-agnostic. A component with business semantic integrity is assembled from several small-grained components and their associated processes according to the needs of users, which is called a Business Component.
(2)业务构件遵循典型的软件模式,且具有唯一标识,稳定不变的属性和操作以及相对可变的属性和操作。(2) Business components follow typical software patterns, and have unique identifiers, stable attributes and operations, and relatively variable attributes and operations.
(3)业务构件分为干业务构件和复用业务构件两类,干业务构件(StemBusiness Component)是指所包含的属性、操作的全集。复用业务构件(ReusedBusiness Component)是将干业务构件中的可变特征变为固定特征后的构件。(3) Business components are divided into two types: stem business components and reuse business components. Stem business components (StemBusiness Component) refer to the complete set of attributes and operations included. Reused Business Component (ReusedBusiness Component) is a component after changing the variable features in dry business components into fixed features.
所述业务构件是一种企业生产和经营过程中所处理的业务对象的软构件实现结果,包含对象的数据信息及相关的业务活动,是一种具有完整业务语义的模式化大粒度构件。The business component is a software component realization result of a business object processed in the production and operation process of an enterprise, including object data information and related business activities, and is a patterned large-grained component with complete business semantics.
业务构件依据其生命周期所处阶段的不同关注点,划分为属性操作参数化的干业务构件和依据需求被实例化后的复用业务构件。干业务构件是业务单据范畴内的功能全集,复用业务构件是干业务构件派生出的功能子集。Business components are divided into dry business components parameterized by attribute operations and reusable business components instantiated according to requirements according to different concerns of their life cycle stages. The dry business component is a complete set of functions within the category of business documents, and the reusable business component is a subset of functions derived from the dry business component.
业务构件模型在开发与部署过程中被分阶段的多重生成为干业务构件和复用业务构件。在开发阶段将上述模型输入代码生成器,将与其匹配模式的非实例化构件实例化为与模型描述一致的干业务构件可执行程序。在部署阶段,系统自动部署工具读取部署需求,将干业务构件派生为若干个实例构件。The business component model is multi-generated into dry business components and reused business components in stages during the development and deployment process. In the development stage, the above model is input into the code generator, and the non-instantiated components matching the pattern are instantiated into executable programs of dry business components consistent with the model description. In the deployment phase, the automatic deployment tool of the system reads the deployment requirements and derives the main business components into several instance components.
具体实施方式二:下面结合图2具体说明本实施方式。本实施方式与实施方式一的不同点是:在步骤二中获取的业务构件平台相关模型,采用源码级模式描述语言定义J2EE平台上业务构件的用户模式和实现模式,其中模式描述语言具有通用性,可适用于多种能够高级编程语言所能实现的软件模式。所述表达方法包括:Specific Embodiment 2: The present embodiment will be specifically described below with reference to FIG. 2 . The difference between this embodiment and Embodiment 1 is that the relevant model of the business component platform obtained in step 2 uses a source code-level schema description language to define the user schema and implementation schema of the business component on the J2EE platform, wherein the schema description language is universal , can be applied to a variety of software patterns that can be realized by high-level programming languages. The expression methods include:
i、软件模式分类方法,将软件模式划分为面向使用者的用户模式(UserPattern,UP)与面向软件的实现模式(Realization Pattern,RP)两类。用户模式体现为软件与客户端用户的交互风格,实现模式是从软件开发角度表现为一种实现方案或运行机制。前者是后者的外在表现,后者是前者的技术支撑。i, software pattern classification method, software patterns are divided into user-oriented user pattern (UserPattern, UP) and software-oriented realization pattern (Realization Pattern, RP) two categories. The user mode is reflected in the interaction style between software and client users, and the implementation mode is an implementation scheme or operating mechanism from the perspective of software development. The former is the external performance of the latter, and the latter is the technical support of the former.
ii、源代码级的实现模式描述语言(Realization Pattern DescriptionLanguage,RPDL),该语言定义为:<RPDL>::=<静态代码>|<动态代码><动态代码到静态代码的转换规则>ii. Realization Pattern Description Language (RPDL) at the source code level, which is defined as: <RPDL>::=<static code>|<dynamic code><dynamic code to static code conversion rule>
<静态代码>::=<目标程序语言所描述的内容><static code>::=<content described in target programming language>
<动态代码>::=<动态变量开始符><待实例化的动态变量><动态变量结束符><Dynamic code>::=<Dynamic variable start character> <Dynamic variable to be instantiated> <Dynamic variable end character>
<待实例化的动态变量>::=<用程序语言A定义的变量><dynamic variable to be instantiated>::=<variable defined in programming language A>
<动态代码到静态代码的转换规则>::=<转换规则的开始符><基于A的转换规则内容><转换规则结束符><Conversion rule from dynamic code to static code>::=<start character of conversion rule><content of conversion rule based on A><end character of conversion rule>
具体实施方式三:下面结合图3具体说明本实施方式。本实施方式与实施方式一的不同点是:在步骤二中获取的业务构件平台相关模型用下述方法予以表达:该方法是一种基于J2EE平台(本领域公知)的业务构件PSM模型表达方法,所述方法包括以下步骤:Specific Embodiment Three: The present embodiment will be specifically described below in conjunction with FIG. 3 . The difference between this embodiment and embodiment one is: the business component platform-related model obtained in step 2 is expressed by the following method: this method is a business component PSM model expression method based on the J2EE platform (well known in the art) , the method includes the following steps:
i、以Brown模型(本领域公知)作为业务构件的分层体系结构模型,确定构件由若干种小粒度构件和连接子的组装构成。各层次间的中等粒度构件由外部连接子互连,每个层次上则有内部连接子组装成中等粒度构件。i. Taking the Brown model (well known in the art) as the layered architecture model of the business component, it is determined that the component is composed of several kinds of small-grained components and the assembly of connectors. The medium-grained components of each level are interconnected by external connectors, and each level is assembled into medium-grained components by internal connectors.
ii、基于上述确定的体系结构,选用一系列相关的软件子模式和组装子模式作为业务构件实现的基础。针对每个体系结构层面建立业务构件的实现模型。依次建立表示层构件规约、应用控制层构件规约、业务逻辑层构件规约、关系对象层构件规约和数据源层规约,以及这些层次之间的映射与关联关系,完成一个完整的业务构件模型描述。ii. Based on the above determined architecture, select a series of relevant software sub-patterns and assembly sub-patterns as the basis for business component realization. Establish the implementation model of business components for each architectural level. Establish the presentation layer component specification, the application control layer component specification, the business logic layer component specification, the relational object layer component specification and the data source layer specification in sequence, as well as the mapping and association relationship between these layers, and complete a complete business component model description.
具体实施方式四:下面结合图4具体说明本实施方式。本实施方式与实施方式一的不同点是:步骤三和步骤四采用了一种基于模式的分阶段代码生成方法来实现,具体的步骤三为:Specific Embodiment 4: The present embodiment will be specifically described below with reference to FIG. 4 . The difference between this embodiment and Embodiment 1 is that step 3 and step 4 are realized by a pattern-based phased code generation method, and the specific step 3 is:
将业务构件的共性抽象为模式,基于模式定义非实例化的构件(模板),而将那些面向业务语义的个性内容描述为业务构件模型。基于模式的非实例化构件与模型之间存在型-值关系,前者提供了基于语法的构件型描述,后者提供了面向业务语义的构件值描述。在开发阶段,通过代码生成器将这两部分内容融合起来,可转换得到一个具体的业务构件。The generality of business components is abstracted into patterns, and non-instantiated components (templates) are defined based on the patterns, and those individual contents oriented to business semantics are described as business component models. There is a type-value relationship between schema-based non-instantiated components and models, the former provides a syntax-based description of component types, and the latter provides a description of component values oriented to business semantics. In the development stage, the two parts are fused through the code generator, and a specific business component can be converted.
具体的步骤四为:部署阶段经过两个主要步骤:第一步,配置权限相关的干业务构件成为可执行的复用业务构件。业务构件配置文件对干业务构件的复用实现机制可采用动态或固化两种方式。动态获取配置信息是指在业务构件每次运行过程中读取配置文件内容,解析且依据其内容自动重组构件内部业务逻辑以实现复用。固化配置信息是指将配置信息写入干业务构件的副本,给每个用户或角色生成专用的复用业务构件。第二步,将复用业务构件安装部署到实际系统运行环境中。基于业务构件的企业应用软件中工作流引擎在可执行工作流模型的控制下动态组装复用业务构件来为不同用户提供不同的服务。The specific step four is: the deployment phase goes through two main steps: the first step is to configure the dry business components related to permissions to become executable multiplexed business components. The business component configuration file can implement the reuse mechanism of dry business components in two ways: dynamic or fixed. Dynamic acquisition of configuration information refers to reading the content of the configuration file during each operation of the business component, parsing and automatically reorganizing the internal business logic of the component based on its content to achieve reuse. Fixing configuration information refers to writing configuration information into a copy of dry business components, and generating dedicated reused business components for each user or role. The second step is to install and deploy the reused business components to the actual system operating environment. The workflow engine in the enterprise application software based on business components dynamically assembles and reuses business components under the control of the executable workflow model to provide different services for different users.
具体实施方式五:下面结合图5具体说明本实施方式。对本发明的技术方案进行详细的说明。Fifth specific embodiment: The present embodiment will be specifically described below in conjunction with FIG. 5 . The technical solution of the present invention is described in detail.
本发明的核心思想就是将软件的可变性分解到软件开发的各个阶段,依不同关注点在各个阶段中分别予以软件实现。在业务构件建模阶段,针对业务功能需求建立业务构件PSM模型,在开发阶段,将源码级非实例化构件模板实例化为干业务构件,在部署阶段,面向特定需求进一步将干业务构件派生为复用业务构件。本方法直观显示地描述构件实现模型并转换为代码,从而加速软件的模式化规模化自动化开发。The core idea of the present invention is to decompose the variability of software into each stage of software development, and implement software in each stage according to different concerns. In the business component modeling phase, the business component PSM model is established according to the business function requirements. In the development phase, the source-level non-instantiated component template is instantiated into a dry business component. In the deployment phase, the dry business component is further derived for specific requirements. Reuse business components. This method visually describes the component implementation model and converts it into code, thereby accelerating the model-scale and large-scale automatic development of software.
参见图1,首先,软件开发人员在特定软件模式基础上建立表达业务功能的业务构件平台相关模型;将该模型输入代码生成器,转换为干业务构件可执行程序;然后,部署阶段面向特定用户需求再将干业务构件完全实例化为复用业务构件。本发明以基于J2EE应用服务器上的业务构件开发过程为例,进行详细的说明。Referring to Figure 1, firstly, software developers establish a business component platform-related model expressing business functions on the basis of a specific software model; input the model into a code generator, and convert it into an executable program of dry business components; then, the deployment stage is oriented to specific users Requirements fully instantiate dry business components into reusable business components. The present invention is described in detail by taking the business component development process based on the J2EE application server as an example.
参见图2,在软件外观层次,用户模式分别从用户界面的结构和用户操作的流程两个方面描述软件的外特性。在软件实现层次,实现模式依据分层体系结构各层次和其间关系模式来描述构件的实现方式。将那些用于实现父结点的模式被称作子模式。业务构件模式是由一系列子模式(用户子模式和实现子模式)构成的集成体,父模式与子模式之间存在包含关系,两个实现子模式之间需要根据接口模式进行关联。Referring to Figure 2, at the software appearance level, the user mode describes the external characteristics of the software from two aspects: the structure of the user interface and the flow of user operations. At the level of software implementation, the implementation pattern describes the implementation of components according to each level of the layered architecture and the relationship between them. Patterns that implement parent nodes are called child patterns. The business component pattern is an integration composed of a series of sub-patterns (user sub-pattern and implementation sub-pattern). There is an inclusion relationship between the parent pattern and the sub-pattern, and the two implementation sub-patterns need to be associated according to the interface pattern.
一种源代码级的实现模式描述语言RPDL(请发明人翻译或解释RealizationPattern Description Language,RPDL)从代码实现角度指导业务构件的开发。例如表示层中数据项的实现子模式描述,如表1所示。表1是关于JSP(请发明人翻译或解释)界面以单元格形式显示多个数据项的实现模式的代码描述,这个片段从(2)到(5)行是采用JAVA语言定义的转换规则内容,其主要功能是对(7)行中由<#和#>限定的动态代码进行初始赋值。行(5)是此模式的核心功能,表示第(7)行中代码会依据数据源基数而多次迭代出现,每次出现时动态代码将被实例化为不同静态代码值。A source code-level implementation pattern description language RPDL (request the inventor to translate or explain Realization Pattern Description Language, RPDL) guides the development of business components from the perspective of code implementation. For example, the implementation sub-pattern description of data items in the presentation layer is shown in Table 1. Table 1 is about the code description of the JSP (ask the inventor to translate or explain) interface to display multiple data items in the form of a cell, and this fragment is from (2) to (5) lines that adopt the conversion rule content defined by the JAVA language , its main function is to perform initial assignment to the dynamic code delimited by <# and #> in line (7). Line (5) is the core function of this mode, which means that the code in line (7) will iteratively appear multiple times according to the data source cardinality, and the dynamic code will be instantiated into different static code values each time it appears.
表1Table 1
业务构件由若干个小粒度构件通过内部或外部连接子连接而组装形成。由此,业务构件PSM模型由唯一标识、选定的构件模式、基于分层结构的核心模型、用于支持可变性的配置模型以及外部接口模型共同组成,参见图3。表示层是业务构件与用户直接交互的接口。一个业务构件总是由若干个相互关联的用户界面构成,为用户提供提交请求与反馈处理结果等服务。各用户界面之间存在相互调用或一般性的链接关系。业务逻辑层是响应客户端的用户需求并进行处理的核心逻辑程序。基于J2EE平台上业务逻辑层的实现模式可表述为:它由若干包和类组成,其中常规操作的方法实现可由代码生成器依据模式定义而自动生成获取,存储在默认类文件中;那些根据用户需求在扩展机制的约束下由程序员手工开发的方法则存储于扩展类文件中;核心控制类负责对其进行服务编排与方法调用。数据层模型是在关系数据模式下描述业务构件的数据库外模式模型,描述了构件业务逻辑层处理的数据视图与实际数据库中的数据视图之间的映射关系。A business component is formed by assembling several small-grained components through internal or external connections. Thus, the business component PSM model is composed of a unique identifier, a selected component mode, a core model based on a layered structure, a configuration model for supporting variability, and an external interface model, see Figure 3. The presentation layer is an interface for direct interaction between business components and users. A business component is always composed of several interrelated user interfaces, providing users with services such as submitting requests and feedback processing results. There is a mutual call or a general link relationship among various user interfaces. The business logic layer is the core logic program that responds to and processes the user needs of the client. The implementation pattern of the business logic layer based on the J2EE platform can be expressed as: it consists of several packages and classes, among which the method implementation of routine operations can be automatically generated and acquired by the code generator according to the pattern definition, and stored in the default class file; The methods manually developed by the programmer under the constraints of the extension mechanism are stored in the extension class file; the core control class is responsible for its service arrangement and method call. The data layer model is an out-of-database model that describes business components in relational data mode, and describes the mapping relationship between the data view processed by the component business logic layer and the data view in the actual database.
代码生成过程的基本原理如下所述,输入:基于某种模式的业务构件模型X;输出:业务构件代码.其内容如下:(1)解析业务构件模型的模式标识,在模式库中检索并获取相应模式的非实例化构件;(2)扫描非实例化构件内容,当找到一个动态代码时,检索X中与其对应的数据进行代码转换;(3)重复执行(1)直到非实例化构件中不存在动态代码为止,转到(4);(4)打印最终的构件代码。代码生成器的工作原理参见图4所示,采用基于模式的混合代码生成方式。每次启动代码生成器时,都要在其内部构造一个为指定业务构件“量身定做”的代码书写器,代码书写器是采用JAVA中的标准输出流“PrintWriter Out”,通过Out对象的Println(请发明人翻译或解释)方法实现在目标文件中打印字符。The basic principle of the code generation process is as follows, input: business component model X based on a certain pattern; output: business component code. The content is as follows: (1) Analyze the pattern identification of the business component model, retrieve and obtain it in the pattern library The non-instantiated component of the corresponding mode; (2) scan the content of the non-instantiated component, and when a dynamic code is found, retrieve the corresponding data in X for code conversion; (3) repeat (1) until the non-instantiated component Until there is no dynamic code, go to (4); (4) print the final component code. Refer to Figure 4 for the working principle of the code generator, which adopts a pattern-based hybrid code generation method. Every time the code generator is started, a "tailor-made" code writer for the specified business component must be constructed inside it. The code writer uses the standard output stream "PrintWriter Out" in JAVA, and passes the Println of the Out object. (ask the inventor to translate or explain) the method realizes printing characters in the target file.
业务构件生命周期内分阶段,阶段内又逐层映射、层内分组的配置方案,参见图5。经过开发、部署和应用三个必要阶段。在每个阶段中,软件开发者所关注的构件属性各不相同。在开发阶段,开发者将依据用户的业务需求着重定义构件的固定部分,如数据集和操作集的构成要素、相应的业务对象必须经历的生命周期状态集、界面风格、操作模式等;而部署和应用阶段,更关注于构件中可变部分的实现,其中权限相关的属性和用于满足个性化需求的属性可以在部署和应用阶段分别实例化。The business component life cycle is divided into stages, and the stage is mapped layer by layer, and the configuration scheme of layer grouping is shown in Figure 5. After three necessary stages of development, deployment and application. In each stage, the attributes of components that software developers pay attention to are different. In the development phase, the developer will focus on defining the fixed parts of the component according to the user's business needs, such as the constituent elements of the data set and the operation set, the life cycle state set that the corresponding business object must go through, the interface style, and the operation mode, etc.; and the deployment and the application phase, more focus on the realization of the variable part in the component, where the properties related to permissions and the properties used to meet individual needs can be instantiated in the deployment and application phases.
在上述的业务构件建模、代码生成与部署配置过程中,通过可视化建模工具实现业务构件模型,通过代码生成器将业务构件模型转换为干业务构件代码,系统部署工具实现干业务构件派生为复用构件代码。In the above-mentioned process of business component modeling, code generation and deployment configuration, the business component model is realized through the visual modeling tool, the business component model is converted into the dry business component code through the code generator, and the system deployment tool realizes that the dry business component is derived as Reuse component code.
最后,还需要注意的是,以上列举的尽是本发明的一个具体实施例。显然,本发明不限于以上实施例,还存在许多变形。本领域普通技术人员能从本发明公开的内容直接导出或联想到得所有变形,均应认为是本发明的保护范围。Finally, it should also be noted that what is listed above is only a specific embodiment of the present invention. Obviously, the present invention is not limited to the above embodiments, and there are many variations. All deformations that can be directly derived or conceived by those skilled in the art from the content disclosed in the present invention should be considered as the protection scope of the present invention.
该大粒度构件(也称为业务构件)提供了一种在J2EE平台上模式化的建立业务构件实现模型的方式,基于模式的代码生成方法提供了一种具有通用性和扩展性的代码生成机制,依据业务构件的生命周期各阶段内的特征,将其划分为干业务构件和复用业务构件两种类型的构件。基于本生成机制构造的代码生成器读取用户所建的完整业务构件PSM模型即可快速获得初始实例化的干业务构件程序,构件被部署过程中可通过动态配置方式将其进一步完全实例化为面向特定用户需求的复用业务构件。This large-grained component (also known as business component) provides a pattern-based way to establish a business component implementation model on the J2EE platform, and the pattern-based code generation method provides a universal and extensible code generation mechanism According to the characteristics in each stage of the life cycle of business components, it is divided into two types of components: dry business components and reused business components. The code generator constructed based on this generation mechanism can quickly obtain the initial instantiated dry business component program by reading the complete business component PSM model built by the user. During the deployment process of the component, it can be further fully instantiated into Reusable business components for specific user needs.
Claims (7)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2009100717795A CN101533349B (en) | 2009-04-15 | 2009-04-15 | Platform-related model of large-granularity components and method of automatic code generation thereof |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2009100717795A CN101533349B (en) | 2009-04-15 | 2009-04-15 | Platform-related model of large-granularity components and method of automatic code generation thereof |
Publications (2)
Publication Number | Publication Date |
---|---|
CN101533349A CN101533349A (en) | 2009-09-16 |
CN101533349B true CN101533349B (en) | 2012-06-27 |
Family
ID=41103969
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN2009100717795A Expired - Fee Related CN101533349B (en) | 2009-04-15 | 2009-04-15 | Platform-related model of large-granularity components and method of automatic code generation thereof |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN101533349B (en) |
Families Citing this family (17)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2012023296A1 (en) | 2010-08-16 | 2012-02-23 | 三菱電機株式会社 | Control program generation device, control program generation program, and control program generation method |
CN102548042B (en) * | 2010-12-30 | 2014-10-15 | 北京亿阳汇智通科技股份有限公司 | Platform and method for customizing and releasing mobile terminal application software in self-service mode |
CN102087597B (en) * | 2011-02-14 | 2014-08-20 | 浪潮通信信息系统有限公司 | J2EE and component set-based visualized development platform |
CN102135888A (en) * | 2011-03-26 | 2011-07-27 | 陈永胜 | Programming platform system for programming by using descriptive language |
CN103425467B (en) * | 2012-05-18 | 2016-08-03 | 汪巨森 | Program creating method based on IEC61850 |
CN103809947B (en) * | 2012-11-09 | 2016-04-20 | 腾讯科技(深圳)有限公司 | A kind of method for automatically releasing of development requirement and system |
CN103345386A (en) * | 2013-05-31 | 2013-10-09 | 电子科技大学 | Software production method, device and operation system |
CN103605528A (en) * | 2013-12-16 | 2014-02-26 | 北京中电普华信息技术有限公司 | Service development method and device |
CN104951285B (en) * | 2014-03-24 | 2018-08-03 | 钱静 | By calling the method and system of result of calculation is obtained with tuning algorithm |
CN103995699A (en) * | 2014-05-13 | 2014-08-20 | 中国神华能源股份有限公司 | Electric power enterprise information system development method based on MDA |
CN104166546B (en) * | 2014-08-01 | 2017-09-22 | 清华大学 | A kind of realization method and system towards DDS application software based on MDA |
CN104360859B (en) * | 2014-11-14 | 2017-08-25 | 中国建设银行股份有限公司 | A kind of visual service development method and system |
CN104461540A (en) * | 2014-12-10 | 2015-03-25 | 浙江图讯科技有限公司 | Code generator development method |
CN105608258B (en) * | 2015-12-16 | 2018-12-14 | 苏州同元软控信息技术有限公司 | A kind of Model-based diagnosis and information flow visual simulation system and method |
CN107657150A (en) * | 2017-09-07 | 2018-02-02 | 北京荣之联科技股份有限公司 | One kind visualization analysis of biological information instrument generation method and device |
CN108897581B (en) * | 2018-06-07 | 2022-03-04 | 北京奇艺世纪科技有限公司 | Service deployment method and device and electronic equipment |
CN110134383A (en) * | 2019-05-09 | 2019-08-16 | 中国航空工业集团公司西安航空计算技术研究所 | Automatic skeleton code generation method and device under a kind of airborne IMA framework |
-
2009
- 2009-04-15 CN CN2009100717795A patent/CN101533349B/en not_active Expired - Fee Related
Non-Patent Citations (2)
Title |
---|
冯锦丹,战德臣,聂兰顺,徐晓飞.基于模式的业务构件代码生成方法.《电子学报》.2008,第36卷(第12A期),正文第1,2,4,5部分. * |
战德臣, 冯锦丹,聂兰顺,徐晓飞.ICEMDA:一种可互操作可配置可执行的模型驱动体系结构.《电子学报》.2008,第36卷(第12A期),正文第1-7部分. * |
Also Published As
Publication number | Publication date |
---|---|
CN101533349A (en) | 2009-09-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN101533349B (en) | Platform-related model of large-granularity components and method of automatic code generation thereof | |
Tisi et al. | On the use of higher-order model transformations | |
Apel et al. | Language-independent and automated software composition: The FeatureHouse experience | |
CN101763064B (en) | Process object-oriented design system and method for NC machining process of aircraft complex components | |
Krahn et al. | Roles in software development using domain specific modeling languages | |
US20160299745A1 (en) | Development method for web development system, and web development system | |
Pescador et al. | Pattern-based development of domain-specific modelling languages | |
US20040158820A1 (en) | System for generating an application framework and components | |
CN105512304A (en) | Method for generating internet applications on line, system integration method and supporting platform | |
Wood et al. | A model-driven development approach to mapping UML state diagrams to synthesizable VHDL | |
CN1983172A (en) | Design pattern and method of transformation of an object model | |
CN105242914A (en) | Model driven code generation method and system | |
CN113626026B (en) | Code generation method supporting complex model structure conversion | |
Kolovos | An extensible platform for specification of integrated languages for model management | |
CN104317559A (en) | Visual modeling platform based on GMF | |
Lourenço et al. | OSTRICH-a type-safe template language for low-code development | |
Broy et al. | Software and system modeling based on a unified formal semantics | |
CN105335161B (en) | It is a kind of from TASM time abstractions state machine to extension NTA automatic machines conversion method | |
JP2011515755A (en) | Development method and apparatus for reserved component container base software | |
Guerra et al. | Inter-modelling with patterns | |
CN102520963A (en) | Method and system for realizing service logic processing based on strongly-typed relation mapping | |
Bennett et al. | Aspect-oriented model-driven skeleton code generation: A graph-based transformation approach | |
JP3562435B2 (en) | Automatic component generator | |
Julius et al. | A meta-model based environment for GRAFCET specifications | |
Křikava et al. | SIGMA: Scala internal domain-specific languages for model manipulations |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20120627 Termination date: 20150415 |
|
EXPY | Termination of patent right or utility model |