forked from pfisterer/fabric
/
README
155 lines (109 loc) · 5.74 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
----------------------------------------
FABRIC
----------------------------------------
Fabric is a framework for code generation based on several scientific
publications [1,2,3,4,5]. It is comprised of components for
- parsing XML Schema and WSDL files into a tree structure, for
- a module API to walk the tree for codegeneration, and for
- code generation (Java, C, C++) using simple APIs instead of
writing to stdout.
In addition, a number of modules are contained that generate code:
- typegen: A generator to create JavaBean-like container
classes from XML Schema documents for both Java and C++.
- exi: An implementation of the Efficient XML Interchange
specification (http://www.w3.org/TR/exi) for XML (de-)
serialization.
- midgen4j: A framework [5] to create a service provider for
various message-oriented Java middleware technologies.
- midgen4j-rest: A MidGen4J extension to create a REST
interface for the Java service provider.
- midgen4j-websockets: A MidGen4J extension to create a
WebSockets interface for the Java service provider as
well as a test client to use the service in a browser.
Formerly, the framework also contained the following modules,
which are no longer included and/or maintained:
- microFibre: An XML (de-)compression scheme usable for
ressource-constraint devices [2,3] that generates code
for Java and C++.
- macroFibre: An XML (de-)serialization scheme for
ressource-constraint devices [3] that generates code
for Java and C++.
- XML: XML (de-)serialization for easy conversion from/to
microFibre/macroFibre.
- protobuf: Converts XML Schema files to Google protobuf
(http://code.google.com/p/protobuf) files.
Fabric works as follows:
1.) Input files are XML Schema or WSDL documents, which are parsed
into a tree. This tree contains most information from the schema
but abstracts away from all the nasty details of XML Schema
and WSDL. It automatically resolves all imports, references,
etc. and the resulting tree can directly be used for code
generation based on tree-walking.
2.) A so-called workspace is created that can be used for code
generation. A workspace represents a set of files of a certain
language (e.g., Java files) in memory. Users of the workspace use
language-specific APIs to add components to the files (e.g., a
Java class). To such elements, further stuff can be added (e.g.,
methods). The benefit over directly writing code to stdout is
that code can be added at any time and in almost any order. Once
the generation is done, the workspace can be serialized to disk.
3.) A set of modules is invoked to handle the parsed documents. Each
module may provide multiple item handlers, e.g. to walk the object
tree of an XML Schema or to process the elements of a WSDL file.
4.) Eventually, the workspace is written to disk.
----------------------------------------
CONTACT / WEBSITE
----------------------------------------
Any feedback concerning Fabric or one of its modules is greatly
appreciated. The GitHub fork https://github.com/nepa/fabric is
currently maintained by:
Sascha Seidel <NetPanther@gmx.net>
Further information about the Fabric framework can be found at:
http://www.nptech.de/fabric
----------------------------------------
INSTALLATION / BUILDING
----------------------------------------
No installation is required. To build Fabric, you need at
least Java 6 and Maven 2 or later (http://maven.apache.org).
Before cloning this repository, be sure to enable automatic
conversion of CRLF/LF on your machine using:
git config --global core.autocrlf input
For more information, please refer to:
https://help.github.com/articles/dealing-with-line-endings
Clone the repository using:
git clone git://github.com/nepa/fabric.git
To build the project, run "mvn install" from the command line.
This will build Fabric and place the generated jar file in
target/ and in your local Maven repository.
If you encounter dependency problems, read third-party/INSTALL.
----------------------------------------
USAGE
----------------------------------------
java -jar core/target/fabric.core-1.0.one-jar.jar --help
----------------------------------------
LICENSE
----------------------------------------
Fabric is released under the Modified BSD license. For more
details, please see src/etc/license-header.txt.
When you use Fabric for scientific publications, we would
appreciate if the papers below are referenced.
----------------------------------------
REFERENCES
----------------------------------------
[1] Dennis Pfisterer, Horst Hellbrueck, and Stefan Fischer. Fabric:
Towards data type-centric middleware synthesis. In Proceedings
of the Euro-American Workshop on Middleware for Sensor Networks
in conjunction with the International Conference on Distributed
Computing (DCOSS 06), 2006.
[2] Dennis Pfisterer, Marco Wegner, Horst Hellbrueck, Christian Werner,
and Stefan Fischer. Energy-optimized data serialization for
heterogeneous WSNs using middleware synthesis. In Proceedings of
The Sixth Annual Mediterranean Ad Hoc Networking Workshop
(Med-Hoc-Net 2007), pages 180-187, June 2007.
[3] Dennis Pfisterer: Comprehensive Development Support for Wireless
Sensor Networks, PhD Thesis, Institute of Telematics, University
of Luebeck, Germany, 2007.
[4] Sascha Seidel: Metaebene - Fabric als Code Generation Framework
für Java, C und C++. In Proceedings of LinuxTag Berlin, May 2012.
[5] Sascha Seidel: Middleware generation based upon machine-readable
service descriptions. Master thesis. Lübeck, July 2013.