Mixed Generative and Handcoded Development of Adaptable data-centric - - PowerPoint PPT Presentation
Mixed Generative and Handcoded Development of Adaptable data-centric - - PowerPoint PPT Presentation
Mixed Generative and Handcoded Development of Adaptable data-centric Business Applications 27th October 2015 Pedram Mir Seyed Nazari, Alexander Roth, and Bernhard Rumpe Software Engineering RWTH Aachen http://www.se-rwth.de/ Alexander Roth
Alexander Roth Lehrstuhl für Software Engineering RWTH Aachen
Seite 2
Motivation
- A data-centric business application
- is based on structured, consistent information
- aims at controlling, accessing and managing data
- E.g.: MS Access, human resource management, etc.
- Common business applications provide [MV09, SPHV10]
- CRUD (create, read, update, delete) functionality for
managed data
- search functionality
- persistence functionality
Alexander Roth Lehrstuhl für Software Engineering RWTH Aachen
Seite 3
Motivation
- Goal: Generative development of data-centric business applications
- generate as much code as possible
- from an abstract description and
- provide mechanisms for adaptations
- A solution should regard
- consistency of generated data structure at all time
- light-weight approach (consider the different levels of users)
- rapid and high customizability (regeneration without loss)
Alexander Roth Lehrstuhl für Software Engineering RWTH Aachen
Seite 4
Generative Development Overview
Parame- terized generator Generator script/template Map: concept code model manually written code runtime system Environment: hardware, GUI, frameworks generated code + included parts
Predefined
components
Predefined
components
Predefined
components
API API domain model describes the domain of interest transforms model into code generated business application handwritten extensions
Alexander Roth Lehrstuhl für Software Engineering RWTH Aachen
Seite 5
Data Explorer (DEx)
- DEx is a generator for (parts of) business applications
- Input: Class Diagram
- Generated result:
- Running application for managing data modeled
in the class diagram
- A graphical user interface
- Support for storing data in the cloud
DEx generator
DEx product: Java Swing Application CD4A The model: A textual class diagram
Alexander Roth Lehrstuhl für Software Engineering RWTH Aachen
Seite 6
A Social Network
Person Date lastVisit String firstName String secondName Date dateOfBirth int zip String city String country «abstract» Profile String profileName /int numOfPosts /int friends Group boolean isOpen Date created String purpose /int members profileName 1 *
- rganizer
1 tagged 1 * replyTo 0..1 Relationship boolean isPending Date requested Date accepted «enum» RelationType FRIEND FAMILY FOLLOWER COLLEAGUE OTHER Tag boolean confirmed Photo double height double width picture InstantMessage Date timestamp String content 1.. * * 1 «interface» Post PhotoMessage
- rganized
* 1 invited * 1 initiated * member * * * * received 1 * sent {ordered} {ordered}
CD SocNet derived attribute
- rdered association
qualified associations
Alexander Roth Lehrstuhl für Software Engineering RWTH Aachen
Seite 7
Modeling data-centric Business Applications
- Structural description language represent the domain model
- E.g.: book management, human resource management
- CD4A is
- a textual language to describe class diagrams for analysis
- a simplification of UML/P CD [Sch12]
classdiagram SocNet { abstract class Profile {...} class Person extends Profile{...} association ... ; }
CD
Alexander Roth Lehrstuhl für Software Engineering RWTH Aachen
Seite 8
Example of generated SocNet application
class and interface managed instances baisc functionality
Alexander Roth Lehrstuhl für Software Engineering RWTH Aachen
Seite 9
Mapping CD4A to UI Elements
«abstract» Profile String profileName /int numOfPosts /int friends
CD SocNet..
Relationship boolean isPending Date requested Date accepted * 1 invited * 1 initiated
Alexander Roth Lehrstuhl für Software Engineering RWTH Aachen
Seite 10
Validating Input
association with cardinality [1] a valid String is required
Alexander Roth Lehrstuhl für Software Engineering RWTH Aachen
Seite 11
Role-based Access Control
CRUD operations for every type Roles and users managed with Apache Shiro
Alexander Roth Lehrstuhl für Software Engineering RWTH Aachen
Seite 12
Generated Products
- the DEx product architecture consists of three layers
- Key: reflect possible static knowledge (import)
- Specific classes may import more general classes
generated RTE standard components
Application Core
generated RTE standard components
GUI
generated RTE standard components
Persistence
Alexander Roth Lehrstuhl für Software Engineering RWTH Aachen
Seite 13
Goals of Handcoding
- The goal of handcoding
- extend domain model (data structure)
- add functionality to generated code
- customize generated code
- DEx supports extensions for
- domain model by attributes and methods
- domain model by signatures
- generated GUI code
Alexander Roth Lehrstuhl für Software Engineering RWTH Aachen
Seite 14
- Generated DEx product has this architecture
- HC internal architecture is not in generators control:
- But it is recommended to maintain this architecture
Overview of the Generated Product with HC
RTE standard components
Application Core
RTE standard components
GUI
RTE standard components
Persistence
hand coded hand coded hand coded generated generated generated
Alexander Roth Lehrstuhl für Software Engineering RWTH Aachen
Seite 15
- Required steps
- 1. Add handwritten Java interface XSIG
- 2. Add handwritten Java class XEIMP
- 3. Implement new methods in XEIMP
public interface Group extends dex.socnet.GroupSIG { //... } handwritten Java interface «interface» GroupSIG
Product-CD
«interface» Group GroupImpl GroupEIMP
«hc» «gen» «gen» «hc»
Java
«gen» public abstract class GroupImpl implements dex.socnet.Group { //... }
Extending the generated Product
Alexander Roth Lehrstuhl für Software Engineering RWTH Aachen
Seite 17
Conclusion
- Brief introduction into data-centric business applications
- CD4A to create domain models
- Generative development of data-centric business applications
- Data Explorer (DEx) Generator
- handwritten extensions