More Related Content
Similar to Introducing a Software Generator Framework - JAZOON12
Similar to Introducing a Software Generator Framework - JAZOON12 (20)
More from Stephan Hochdörfer
More from Stephan Hochdörfer (20)
Introducing a Software Generator Framework - JAZOON12
- 2. ABOUT ME
> Stephan Hochdörfer, bitExpert AG
> Department Manager Research Labs
> S.Hochdoerfer@bitExpert.de
> @shochdoerfer
2
- 21. GENERATIVE PROGRAMMING: WORKFLOW
Configuration
Configuration
(DSL)
(DSL)
1..n
Implementation-
Implementation-
components
Generator
Generator Product
Product
components
21
- 22. GENERATIVE PROGRAMMING: WORKFLOW
Configuration
Configuration
(DSL)
(DSL)
Implementation-
Implementation-
components
Generator
Generator Customer 11
Customer
components
22
- 23. GENERATIVE PROGRAMMING: WORKFLOW
Configuration
Configuration
(DSL)
(DSL)
Customer 22
Customer
Implementation-
Implementation-
components
Generator
Generator Customer 11
Customer
components
23
- 25. SOFTWARE SYSTEM FAMILY
Set of applications with similar
properties as well as special properties
for each individual member.
25
- 41. GENERATIVE PROGRAMMING
Generator
Domain Engineering
Domain-
analysis
Domain-
design
Domain-
implementation
41
- 42. GENERATIVE PROGRAMMING
Generator Product
Domain Engineering App. Engineering
New
requirements
Domain- Requirements
analysis analysis
Domain- Product
design configuration
Components,
Domain- DSL, Testing and
implementation Generators,
Infrastructure
integration
42
- 46. GENERATIVE PROGRAMMING: FRAMEWORK
mvn archetype:create
-DarchetypeGroupId=org.replicatorframework
-DarchetypeArtifactId=replicator-maven-archetype
-DarchetypeVersion=0.8.0-SNAPSHOT
-DgroupId=org.replicatorframework
-DartifactId=samplegenerator
46
- 47. GENERATIVE PROGRAMMING: FRAMEWORK
./samplegenerator
|-config
|---generator.properties
|---gpl.xml
|-src
|---main
|-----java
|-----resources
|-------frames
|-------generator
|---------contentProvider.xml
|---------features.xml
|---------frames.xml
|---------generatorContext.xml
|---test
|-----java
|-----resources
|-target
47
- 48. GENERATIVE PROGRAMMING: ADD FEATURE
./src/main/resources/generator/features.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:gp="http://www.replicatorframework.org/schema/gp"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/...">
<gp:feature name="ContactForm" />
<gp:feature name="HintLayer" />
</beans>
48
- 49. GENERATIVE PROGRAMMING: ADD FRAME
./src/main/resources/generator/frames.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:gp="http://www.replicatorframework.org/schema/gp"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/...">
<gp:fileframe id="App.ContactForm"
sourcePath="frames/webroot/form.frm"
exportPath="webroot/form.html">
</gp:fileframe>
<gp:frame id="App.ContactForm.HintLayer"
sourcePath="frames/webroot/hintlayer.frm">
</gp:frame>
<gp:bundle id="App.Resources.Images"
sourcePath="frames/webroot/resources/img"
exportPath="webroot/resources/img" /> 49
</beans>
- 50. GENERATIVE PROGRAMMING: ADD FRAME
./src/main/resources/generator/features.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:gp="http://www.replicatorframework.org/schema/gp"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/...">
<gp:feature name="ContactForm">
<!-- refers to the defined FileFrame -->
<gp:resource ref="App.ContactForm"/>
<!-- refers to the defined ResourceBundle -->
<gp:resource ref="App.Resources.Images"/>
</gp:feature>
<gp:feature name="HintLayer" />
</beans>
50
- 53. GENERATIVE PROGRAMMING: CONTENT
PROVIDER
./src/main/resources/generator/contentProvider.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:gp="http://www.replicatorframework.org/schema/gp"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/...">
<gp:contentProvider id="GenericContentProvider"
type="generic">
<gp:rule>
<gp:condition>
<gp:group type="AND">
<gp:hasFeature name="ContactForm"/>
</gp:group>
</gp:condition>
<gp:bind slot="hello" value="Hello World!"></gp:bind>
</gp:rule>
</gp:contentProvider>
</beans> 53
- 54. GENERATIVE PROGRAMMING: CONTENT
PROVIDER
./src/main/resources/generator/contentProvider.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:gp="http://www.replicatorframework.org/schema/gp"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/...">
<gp:contentProvider id="GenericContentProvider"
type="generic">
<gp:rule>
<gp:condition>
<gp:hasFeature name="HintLayer"/>
</gp:condition>
<gp:bind slot="hint"
ref="App.ContactForm.HintLayer" />
</gp:rule>
</gp:contentProvider>
</beans>
54
- 56. GENERATIVE PROGRAMMING: CONTENT
PROVIDER
./src/java/org/replicatorframework/samplegenerator/MyContentProvider.java
package org.replicatorframework.samplegenerator;
import
org.replicatorframework.generator.frame.contentprovid...
import org.replicatorframework.gpl.FeatureConfiguration;
public class MyContentProvider extends AbstractContentProvider
{
public SlotConfiguration computeSlots(FeatureConfiguration
configuration)
{
SlotConfiguration slots = new SlotConfiguration();
slots.put("hello", "Hello World!");
slots.put("hint",
this.getFrameDefinition("App.ContactForm.HintLayer")
);
return slots;
} 56
}
- 57. GENERATIVE PROGRAMMING: CONFIGURATION
./config/gpl.xml
<?xml version="1.0" encoding="UTF-8"?>
<features xmlns="http://www.replicatorframework.org/schema/gpl"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.replicatorframework.org/...
http://www.replicatorframework.org/schema/gpl/gpl-
0.0.6.xsd">
<feature name="hintLayer">
<param name="color" type="String" value="#000" />
<param name="autoClose" type="Boolean" value="true" />
</feature>
</features>
57