Professional Documents
Culture Documents
HTTPS://SITES.GOOGLE.COM/SITE/JOURNALOFCOMPUTING/
WWW.JOURNALOFCOMPUTING.ORG 143
Abstract— This paper presents a domain-specific, component-based framework to model networked systems and to automate
the networked application software generation. The framework employs two-level model, one for specifying system-level
architecture, and the other for process-level. The former contains unified models for networked elements called as Networked
Nodes(NN). With the instrumentation of Networked Node as a Generic Modeling Environment (GME) metamodel - NetProc, a
networked system becomes composition of NetProcs, Sub-Systems, Shared Objects and their interconnections. At process-
level, modeling of connection management, event detection, de-multiplexing, event dispatching, and composition of dynamically
configured services which are specific to networked elements is supported. The exported model in XML has been parsed and a
proper intermediate structure is constructed. Applying appropriate code generation techniques and by reusing components, the
software generation is automated. The proposed framework supports customization of a networked system and is found to
increase the software productivity.
—————————— ——————————
1 INTRODUCTION
Distributed computer environments are based on distri- interfaces that provide access to its services. Components
buted computer systems, which consist of a set of serve as building blocks for the structure of an application
processing components connected by a communication and can be reused.
network. Networked computing is characterized by sev-
eral sequences of jobs, which arrive independently at var- One of the most suitable design paradigms for domain-
ious nodes. The jobs are designed and implemented more specific modeling methodology is Component-Based De-
or less independently of each other and are loosely sign (CBD)[4]. With main features of reusability of com-
coupled. The distributed system serves primarily as a ponents, and higher level of system abstraction, complex
resource-sharing network. In client server systems, the software systems can efficiently and intuitively be con-
clients represent the users of a distributed system and structed from the prefabricated and reusable components.
servers represent different operating system functions or The software production can be achieved in effectively by
a commonly used application. The development of net- modeling systems rather than programming approach. A
worked application software is still expensive, time con- proper generative programming approach could be de-
suming, and error prone even with the increase in net- veloped to fill the gap between the conceptual system
work bandwidth and computing power. The solution for design models and the concrete system simulation or im-
building high-quality networked software in a time-to- plementation. Automating software product generation
market-driven environment is to provide a way to reuse from a domain-specification and reusable components is
successful software designs and implementations that called Generative Programming (GP)[3][9]. Generative
have already been developed. Systematic reuse is an in- programming automates system implementations from
tentional and concreted effort to create and apply mul- high-level abstractions represented as graphical models.
tiuse software architectures, patterns, frameworks, and Model Driven Development (MDD) is an important tech-
components throughout a product line. This depends nology for meeting the growing demand for highly cus-
largely on how well frameworks model the commonali- tomized-yet reusable-solutions [5]. The challenges of
ties and variability in application domains, such as busi- MDD have been addressed by the well-known approach
ness data processing, telecom call processing, graphical of Commonality-Variability Analysis (CVA).
user interfaces, etc. [1][2][6]. A component is an encapsu-
lated part of a software system that implements a specific This paper describes the use of an integrated Model-
service or set of services. A component has one or more driven Architecture and code generation techniques to
enhance the level of abstraction of networked system, so
———————————————— that automatic synthesis or simulation from system mod-
K.Ramesh is with the National Institute of Warangal A.P. India 506004. els is the result. Based on generative programming me-
thod, a domain-specific, component-based has been con-
T.Ramesh is with the National Institute of Warangal A.P. India 506004. structed to automate the distributed networked applica-
tion software generation[12]. The meta-modeling ap-
proach of framework components in the component de-
sign aspect, and the code generation techniques for com-
JOURNAL OF COMPUTING, VOLUME 2, ISSUE 7, JULY 2010, ISSN 2151-9617
HTTPS://SITES.GOOGLE.COM/SITE/JOURNALOFCOMPUTING/
WWW.JOURNALOFCOMPUTING.ORG 144
ponent implementation aspect are shown in Fig. 1.
generic so that they can easily be adapted to specific
needs. The success of a good framework design lies in
identifying these essential parts and keeping it flexi-
ble[7][8][10]. One requires domain-specific knowledge to
find out these essential parts.
The meta-models of the framework components are Communication part is described with three kinds of de-
represented as the UML class diagrams provided by the tails. First of them is the binding data, which could be the
meta-modeling tool GME [10], a configurable toolkit that IP addresses and port numbers, URLs, and I/O ad-
supports the creation of domain-specific modeling and dresses. Second one involves the connection types as di-
program synthesis environments. For implementing the rect and indirect. Direct connection is the one established
system, the required basic components are fabricated i.e. between the NetProcs directly and can be of active or pas-
coded in its application domain, using a network API sive type. Indirect connections are between the NetProcs
(e.g. Socket API components in ACE framework[11]). and shared objects. Thus NetProcs communicate with
These components are wrapped into the framework com- each other via shared object. IPCs(Inter-Process Commu-
ponents and stored under the repository for reuse. Com- nication) and RPCs(Remote Procedure Call) come under
ponents with more functionality can be generated using indirect communication. The connection management,
these wrapped components. They also can be stored un- event detection, de-multiplexing, and event handler dis-
der the repository as templates for reuse or for develop- patching is supported by the last part called as behavioral
ing similar components. Consequently, these components logic as shown in Fig. 2.
are used to generate the code, which could be used for
simulation or deployment in the real environment.
System as a collection of intercommunicating sub- The metamodel definition of the Action Sequence, Object
systems, processes and shared objects Dependency and Communication Point are as shown in
Process as a set of communication points, compo- Fig.10 and Fig.11.
nents and control logic.
Different attributes of the components and the de-
scription of the dependencies between the compo-
nents.
Fig.11. Meta-models of Object Dependency, Communication Point and Communication Connection developed using
GME.
XML element identification: The ACE-XML parser The whole model can be traversed using these base ob-
is used to identify the contained elements and the im- jects stored in the object pool.
mediate parent for any given element. Based on this
structure, the object tree is constructed with each node The pseudo-code for the Object Tree generation is as fol-
representing a GME element. The attributes associ- lows.
ated with the node (referred as Model Object) are:
GenerateObjectTree(XMLmodel) {
1. ObjectId: This is the identification value of the for each element in XMLmodel, do {
model object. Every model object has a unique id modelObject = createModelObject();
through which it is identified. modelObject.SetAttributes( element.Object ID, ele-
2. ParentId: This is the identification of the immedi- ment.Parent ID, element.Name, element.Kind, ele-
ate parent of the model object. ment.position);
3. AssociatedModel: This is the node in the code if element.Kind is Connection
generation tree to which the model object is modelObject.ConnectionProperties = ele-
mapped. ment.ConnectionProperties;
4. Name: The name of the model object. for each innerXMLmodel in the element, do
5. Kind: The kind of the model objects i.e. method, modeObject.Children = GenerateOb-
class, system, process etc. jectTree(innerXMLmodel);
6. Reference Id: If the model object is a reference to BaseObjects.add(modelObject);
another model object, this attribute holds the ID of ObjectPool.add(modelObject);
the referenced object. }
7. Children: This is to identify the immediate child return BaseObjects;
objects. }
8. Position: The position of the object in the model, Hence, in the system model, the system becomes the
given in XY coordinate system. root of the parse tree and the different components of the
9. ConnectionProperties: If the element is a connec- system and their interconnections form the children of the
tion, this attribute stores the ID of the source and root. The component could even be a sub-system, which
destination model objects. in turn has its corresponding component nodes and inter-
10. ModelAttributes: This contain the set of attrib- connections as children. In the class model, the names-
utes provided to the element, as an input, by the pace forms the root, and the sub-namespaces and classes
user become the children. The children of classes include the
methods, communication methods and properties. This
Generation of Object Tree: When the XML parser tree structure obtained during the parsing stage is ex-
identifies an XML element, a model object to the tree tracted to a file representing the model.
corresponding to the identified element is created.
Now, as the code proceeds, any element contained in- The information of each leaf node (NetProcs) of the
side the current element is identified. For every inner generated tree will be stored in the respective files as the
XML element identified, a new model object is cre- intermediate representation. These files representing the
ated and added into the children of the current model NetProcs will be stored in the folder corresponding to the
object. This model object is then identified as the cur- containing System. This intermediate representation of
rent object. Then the attributes of the current object the system is in a framework-independent form, which
are identified from the attributes and child elements of allows its implementation in any targeted framework.
the XML element. When the current XML element This file-based representation of the system allows the
ends, the immediate parent object is retrieved and reusability of the components at a later stage. The gener-
makes it the current object. This way the nodes are ated intermediate files will be then used to generate the
created in the object tree and the structure of the tree code for the targeted framework.
is identified. The generated object tree is used to gen-
erate code from the code generation tree.
4.2 CODE GENERATION
Storing the Object Tree in Object Pool: The object
pool consist of all the model objects in one set and the
base objects in another. A method is defined in the The generated intermediate file which contains the Ob-
object pool, to access any model object in the whole ject Tree is used to generate an equivalent tree, with the
model using its ID. Methods are also defined, to list nodes capable of generating the code for the object that it
the model objects to which a given model object is represents. For example, for a model object that represents a
connected, for a specified type of connection. Base class, the new tree would contain an associated node, which
objects form the root nodes of the whole mode. generates the code for the class. As each node in the Object
Tree has its corresponding node in the code generating tree,
they are linked to each other. The complete model is
represented by the Code Generating Tree:
JOURNAL OF COMPUTING, VOLUME 2, ISSUE 7, JULY 2010, ISSN 2151-9617
HTTPS://SITES.GOOGLE.COM/SITE/JOURNALOFCOMPUTING/
WWW.JOURNALOFCOMPUTING.ORG 150
The algorithm for the code generator is summarized by file, under the folder corresponding to its namespace,
the following pseudo code. stored in the repository. The algorithm for GenerateC-
lass() is as in the following pseudocode:
GenerateCode(model) {
for each system in model, do { GenerateClass(classModel) {
for each sub-system in system, do //child node of the sys- for each property in classModel, do {
tem if property.DomainClass.found() is true //If the domain
GenerateCode(sub-system.model); class of the property is identifiable from the model,
for each shared-object in system, do //child node of the property.Code = GeneratePropertyCode(property,
system property.DomainClass);
if shared-object. Class.found() is false { //If the class else
associated with shared property.Code = GeneratePropertyCode(property,
property.PropertyType); //Generate property code with
//object does not exist, the specified type.
classFile = GenerateClass(shared-object. Class ); classModel.Code.AddPropertyCode(property.Code);
namespaceFolder = CreateFolder(shared-object. }
Class.Namespace); for each method in classModel, do {
namespaceFolder.insert(classFile); method.GenerateParameterCode();
Repository.Add(namespaceFolder); //Create a //Generate code to set the parameters from the model of
folder in repository for the namespace of the the method
created class method.GenerateInstantiationCode();
} //Generate code to instantiate the objects in the model of
for each process in system, do // child node of the system the method
for each component in process, do { method.GenerateActionCode(method.ActionSequence);
if Repository.Find(component) is false { //Generate the action code for the method.
classFile = GenerateClass(component. Class classModel.Code.AddMethodCode(method.Code);
); }
namespaceFolder = CreateFolder(component. for each communicationMethod in classModel, do {
Class.Namespace); communicationMethod.GenerateParameterCode
namespaceFolder.insert(classFile); communicationMethod.GenerateInstantiationCode
Repository.Add(namespaceFolder); communicationMe-
} thod.GenerateActionCode(method.ActionSequence);
InstantiateObject(component);
IncludeReference(component); // include file refer- clasMo-
ence del.Code.AddMethodCode(communicationMethod.Code);
} }
for each dependentSharedObject in process, do { return classModel.Code;
InstantiateObject(dependentSharedObject); }
IncludeReference(dependentSharedObject);
} The method GenerateActionCode(), used to gener-
process.ActionCode = GenerateAction- ate the code from the Action Sequence, has a key fea-
Code(process.ActionSequence); ture that the code generated by it can be for multi-
processFile = GenerateProcess(process); //Combine threaded application, as per the design specifications.
all the attribute of the process into a single file. This is made possible by linking the generated code to
systemFolder = CreateFolder(system); a module called ‘ActionSequenceManager’. Operations
systemFolder.Add(processFile); are defined on ActionSequenceManager to register the
} Actions and Joins and the order they follow. The ex-
Repository.Add(systemFolder); //Create a folder in ecution of the Action Sequence is then left to the Ac-
repository for tionSequenceManager, which invokes the threads cor-
//the namespace of the created class responding to the actions and joins in the specified
} order. Hence, the scheduling of actions is appropriate-
} ly done in every Action Sequence. The GenerateAc-
tionCode () method merges sequential nodes to a sin-
The generated code could be stored in the reposito- gle node. This optimization improves the
ry along with the model for reuse. This code can be
provided to simulation tools or to build deployable performance by removing unnecessary threads. The
networked application system. pseudo code for GenerateActionCode() is as follows:
Inside every generated thread, The GenerateTh- [6] J. Greenfield, K. Short, S. Cook, and S. Kent, Soft-
read() method has to generate the scope of the Method, ware Factories: Assembling Applications with Patterns,
Communication Method or the Process for which it is Models, Frameworks, and Tools. New York: John Wiley &
running. This is required, as the code generated by the Sons, 2004
nodes is intended for the scope of the Method, but not
of the thread. It is done by packing the variables at the [7] T.J. Todman et al., “Reconfigurable Compu-
Method before spawning the thread to a single object, ting:Architectures and Design Methods,” Proc. IEE,
and unpacking the variables with the same name in- vol. 152,no. 2, Mar. 2005, pp. 193-207.
side the thread.
[8 ] Claudia-Melania Chituc , Ame´ rico Azevedo , Ce´
Hence, using the above algorithm the code for the sar Toscano, A framework proposal for seamless inte-
system and namespaces gets generated inside the Re- roperability in a collaborative networked environment,
pository. This code is then linked to the ACE frame- in Computers Industry 60 (2009) 317–338
work, and to a standard compiler (here it is linked to
the VC++ compiler) to generate the target application. [9] Viswanath Sairaman, Nagarajan Ranganathan and
Neeta S. Singh, An Automatic Code Generation Tool
for Partitioned software in Distributed SystemsPro-
ceedings of the 19th International Conference on VLSI
Design (VLSID’06)
5. CONCLUSIONS
[10] GME: http://www.isis.vanderbilt.edu/projects/gme
A component-based framework aiming at the soft-
ware development in the domain of networked appli- [11] ACE Toolkit,
cation systems has been developed. The framework http://www.cs.wustl.edu/~schmidt/ACE.html
provides the modeling methods for domain-specific
features of a networked system in different aspects, [12] Kin-Yeung Wong, Yin-Man Choi, and Seng-Wa
including component structures and interaction, sys- Lam The Design, Implementation and Application of
tem functionality, etc. A complete formal definition of the Software Framework for Distributed Computing ,
the framework components carried out in GME con- International Journal Of Computers Issue 3, Volume 1,
sists of a metamodel specified as NetProc, which is 2007
exemplified in the paper with ATM sever system. Au-
tomatic synthesis of application implementation has
been done by parsing of models and generating source
files with code generation algorithm. Final result is the
development of networked application system soft-
ware from reusable and reconfigurable components.