• No results found

Concept and Implementation of a Graphical Editor for Composite Application Templates

N/A
N/A
Protected

Academic year: 2021

Share "Concept and Implementation of a Graphical Editor for Composite Application Templates"

Copied!
69
0
0

Loading.... (view fulltext now)

Full text

(1)

Studienarbeit Nr. 2275

Concept and Implementation of

a Graphical Editor for

Composite Application Templates

Xuan Wang Studiengang: Prüfer: begonnen am: beendet am: CR-Klassifikation: Betreuer: Informatik

Prof. Dr. Frank Leymann Dipl. -Inf. Ralph Mietzner 01.11.2009 03.05.2010 C.2.4, D.2.6 Universität Stuttgart Universitätsstraße 38 D - 70569 Stuttgart

(2)

Table of Contents 

1  Introduction ... 3  1.1  Task ... 3  1.2  Structure ... 3  2  Cloud Computing ... 5  2.1  Definition and History of Cloud Computing ... 5  2.2  Three Levels of Cloud Platforms ... 5  2.3  Economics of Cloud Computing ... 9  2.4  Advantages and Risks ... 11  2.5  Component‐Based Application Design ... 13 

3  Composite Application Framework ... 15 

3.1  Introduction ... 15 

3.2  Features of Composite Application Framework... 15 

3.3  Cafe Project ... 16 

4  Eclipse Modeling Projects and Plug-In ... 24 

4.1  Introduction and Background ... 24 

4.2  Eclipse Modeling Framework (EMF) ... 25 

4.3  Graphic Editing Framework (GEF) ... 27 

4.4  Graphic Modeling Framework (GMF) ... 29 

4.5  Plug‐In Development Environment (PDE) ... 31 

5  Implementation of Graphical Editor ... 32 

5.1  Installation of GMF ... 32  5.2  Ecore Model ... 33  5.3  Graphical Definition Model ... 36  5.4  Tooling Definition Model ... 41  5.5  Mapping Model ... 42  5.6  Generator Model ... 45  5.7  Generate Diagram Code ... 46  5.8  GMF Runtime... 47  5.9  CAR File Export ... 53 

6  Discussion and Outlook ... 63 

6.1  Discussion ... 63 

6.2  Outlook ... 63 

7  Bibliography ... 64   

(3)

Figure 2.1 Three Levels of Cloud Computing Structure………6  Figure 2.2 Infrastructure as a Service………..7  Figure 2.3 Platform as a Service………..8  Figure 2.4 Software as a Service………..9  Figure 3.1 Collapsed Example of Cafe Application………..17  Figure 3.2 Extended Example of Cafe Application………..18  Figure 3.3 Ecore Meta‐Model of Cafe Application………..19  Figure 3.4 Component Dependency………..19  Figure 3.5 Component Patterns………20  Figure 3.6 Deployment Relation………21  Figure 3.7 Implementations...21  Figure 3.8 Visible Property...22  Figure 3.9 Requirements...22  Figure 5.1 Create a New GMF Project with Eclipse New Wizard………32  Figure 5.2 Project Folder Structure...33  Figure 5.3 Ecore Model Diagram and Diagram Editor………34  Figure 5.4 Create Graphical Definition Model……….37  Figure 5.5 Figure Gallery...38  Figure 5.6 Rounded Rectangle Properties...39  Figure 5.7 Flow Layout Properties...39  Figure 5.8 Compartment Collapsible...41  Figure 5.9 Tool Palette...41  Figure 5.10 Canvas Mapping Properties...42  Figure 5.11 Top Node Reference...43  Figure 5.12 Node Mapping...43  Figure 5.13 Node Mapping Properties...44  Figure 5.14 Feature Label Mapping Properties………..44  Figure 5.15 Component Child Reference Properties………..45  Figure 5.16 Gen Editor Generator Properties……….46  Figure 5.17 Component Name Edit Part……….46  Figure 5.18 Cafe Application Editor………...48  Figure 5.19 Print………..49  Figure 5.20 View………..49  Figure 5.21 Page Breaks……….50  Figure 5.22 Example...51  Figure 5.23 Car Generator...54  Figure 5.24 Car File...55  Figure 5.25 Extensions...56   

(4)

1 Introduction 

1 Introduction

1.1 Task

Nowadays,  Cloud  Computing  has  raised  a  revolution  in  the  whole  IT  environment.  Plenty of large IT enterprises like IBM, Google, Microsoft and non‐IT enterprises like  Amazon  have  invested  a  lot  to  deploy  and  propagate  their  Cloud  Computing  solutions.  The  traditional  Cloud  Computing  solution  is  composed  of  service  vendor/provider  and  services  consumers,  which  delivers  customer  required  infrastructures,  software,  application  services  and  receive  services  through  paying  per usage. Those services received by customers, generally highly standardized, need  customization  or  even  redeployment  by  a  third  consultant  company,  which  causes  the overspending of IT‐budget and irregularly specified application services. 

 

The  Cafe  project,  based  on  Composite  Application  Framework,  provides  a  new  solution that separating the service vendor and service provider. Service vendor not  only supports service provider at the level of infrastructure and application, but also  provides a standard process. In order to meet the specified requirements of various  customers, service  provider  should  be  capable of  configuring  and  redeveloping  the  application.  This  kind  of  solution  makes  customers  to  acquire  their  own  specified  services  through  month‐based  fees  without  configuration  and  redeployment  by  a  third company. 

 

The  task  of  this  student  research  project  is  to  develop  a  graphical  editor  for  Cafe  application templates, which is based on Eclipse Graphic Modeling Framework (GMF)  and implemented within Eclipse Plug‐In Development Environment (PDE). The editor  is supposed to provide a user‐friendly GUI and allow exporting the Cafe application  templates as a Cafe application archive file at the same time.   

1.2 Structure

The Chapter 2 introduces three levels of Cloud Computing in details, the opportunity  and  risks  in  enterprise  brought  by  Cloud  Computing  and  Component‐based  application design. 

 

The  Chapter  3  involves  the  composite  application  framework,  the  concepts  and  graphical implementation of Cafe application templates. 

 

The Chapter 4 is concerned with background knowledge of Eclipse projects including  Eclipse  Modeling  Framework  (EMF),  Graphic  Editing  Framework  (GEF),  Graphic  Modeling  Framework  (GMF)  and  Plug‐In  Development  Environment  (PDE). 

(5)

Furthermore, it compares GMF with GEF.   

The Chapter 5 covers the detailed implementation of graphical editor, GMF runtime  and the implementation of .car file export. 

(6)

2 Cloud Computing 

2 Cloud

Computing

2.1 Definition and History of Cloud Computing

With the rapid development of Internet technology, Internet‐based applications are  becoming more and more popular and significant. Under the circumstances, a new  concept – Cloud Computing – springs up. Cloud Computing is not a new technology,  but an integration of different existed technologies. 

 

We  define  Cloud  Computing  as  “an  Internet‐based  computing,  where  by  shared  resources,  software  and  information  are  provided  to  computers  and  other  devices  on‐demand, like electricity.”[Clo] A more technical definition by National Institute of  Standards  and  Technology  (NIST)  is  that  “the  Cloud  Computing  is  a  computing  capability  that  provides  an  abstraction  between  the  computing  resource  and  its  underlying  technical  architecture  (e.g.,  servers,  storage,  networks),  enabling  convenient, on‐demand network access to a shared pool of configurable computing  resources  that  can  be  rapidly  provisioned  and  released  with  minimal  management  effort or service provider interaction.”[MG09] 

 

When  Google  raised  the  concept  of  Cloud  Computing,  Amazon  had  implemented  Cloud  Computing  since  2005  by  providing  fees‐based  access  to  their  systems  via  Amazon  Web  Services.  And  also  IBM,  Intel  and  Sun  declared  that  they  had  been  already aware of the Cloud Computing since long. In my opinion, Cloud Computing is  a  further  development  of  Distributed  Computing,  Parallel  Computing  and  Grid  Computing  or  to  put  it  simply  ‐  a  commercialization  of  Grid  Computing.  The  application  area  of  Grid  Computing,  which  has  been  widely  applied  for  scientific  computing or simulation among the research institutes, is limited to scientific scope  and  open  source  communities.  As  the  scientific  fulfillments  can  be  looked  as  open  sources  for  other  scientists,  there  is  no  need  to  require  a  very  high  security  mechanism.  However,  after  the  rapid  growth  of  commercial  environment  requirements,  those  leading  enterprises  have  made  a  lot  of  improvements  to  commercialize and widespread the Grid Computing technology. 

 

2.2 Three Levels of Cloud Platforms

As described in Figure 2.1, there are three levels of Cloud platforms: Infrastructure as  a Service (IaaS), Platform as a Service (PaaS) and Software as a Service (SaaS), which  will be elaborated in this Section. 

(7)

Figure 2.1 Three Levels of Cloud Computing Structure   

2.2.1 Infrastructure as a Service (IaaS)

IaaS is the bottom level abstracting the physical infrastructure. IaaS vendor provides  the computing power, storage and other network infrastructures like firewalls for its  customers,  who  purchase  the  software  and  hold  the  license.  Further  required  is  a  runtime  environment  to  implement  their  applications.  Therefore,  IaaS  can  also  be  seen as Hardware as a Service (HaaS). 

 

Generally  IaaS  vendors  provide  services  based  on  virtualization  technology.  IaaS  customers  should  create  a  virtual  machine  with  some  operation  system  and  other  essential  application  software  like  database,  web  server  and  so  on.  After  the  installation  and  the  configuration  of  applications,  they  have  to  upload  the  whole  virtual machine image to the computer cluster provided by IaaS vendors. During the  running  of  virtual  machine,  IaaS  customers  are responsible to  the  maintenances  of  the  virtual  machine,  while  IaaS  vendors  are  responsible  to  the  maintenances  of  provided  infrastructures.  The  relationship  among  IaaS  customers,  Iaas  vendors  and  end users is described in Figure 2.2. 

(8)

2 Cloud Computing 

 

 

Figure 2.2 Infrastructure as a Service  

The  service  fees  are  based  on  performance  usage  such  as  the  processing  time,  storage  capacity,  the  bandwidth  of  the  network  etc.  A  practical  example  of  IaaS  products is Amazon Web Services. [Pij09] 

 

To  summarize,  “Infrastructure‐as‐a‐service  is  about  replacing  critical  data  center  resources such as space, pipe, firewalls, VPNs, routers, switches, physical servers and  storage with scalable and highly‐available resources in the Cloud. It is about having a  data‐center‐in‐the‐Cloud.”[CF08] 

 

2.2.2 Platform as a Service (PaaS)

At  the  middle  level  stands  the  PaaS.  PaaS  vendors  provide  not  only  the  computing  power,  storage  and  network  infrastructures,  but  also  the  running  environment  as  well  as  some  Cloud  services.  PaaS  customers  occupy  the  application  software  and  the  license.  What  they  need  is  a  running  environment  to  implement  their  applications just like IaaS customers. 

(9)

End User

Customer

Configuration file or Application package

 

Figure 2.3 Platform as a Service  

Figure  2.3  describes  the  process  of  PaaS.  PaaS  vendors  also  use  virtualization  technology. Different to IaaS vendors, they also provide a running environment with  operation  system  and  other  essential  middleware.  PaaS  customers  do  not  need  to  install  the  virtual  machine  and  upload  the  whole  virtual  machine  image.  The  only  thing to upload is the application package or even a configuration file. PaaS vendors  may  provide  some  Cloud  services  such  as  database  service,  data  storage  service,  authentication  service.  The  maintenances  of  the  application  package  retained  by  customers  are  in  the  charge  of  customers,  while  the  maintenances  of  the  Cloud  services  and  virtual  machines  are  in  the  charge  of  PaaS  vendors.  Because  of  the  providing  of  standard  Cloud  services  and  installed  virtual  machines,  PaaS  is  less  flexible than IaaS. 

 

The service fees are also based on performance usage. A practical example of PaaS  products is Google App Engine. [Pij09] 

 

To  summarize,  “PaaS  offerings  provide  a  set  of  basic  services,  including  virtual  servers,  storage,  and  databases.  You  can  use  these  services  to  build  an  application  on  top  of  the  PaaS  platform  with  the  tools,  or  APIs,  provided  by  the  PaaS  platform.”[Cha10] 

 

2.2.3 Software as a Service (SaaS)

(10)

2 Cloud Computing  environment  and  infrastructures,  SaaS  vendors  also  provide  already  implemented  applications as services. SaaS customers neither purchase their own applications or  the license nor upload any application package or configuration file. The only thing  they need to do is to pay for the SaaS‐fees. Therefore SaaS customers are also the  end users. SaaS vendors are in charge of managing the software license, maintaining  applications  and  providing  a  hosting  environment.  Another  possibility  is  that  SaaS  venders could also be the customers of other IaaS or PaaS venders. However, lacking  of  successful  Cloud  Computing  cases  causes  most  SaaS  venders  hold  the  infrastructure  and  platform,  where  the  applications  run.  SaaS  customers  have  to  accept  the  standard  applications  provided  by  SaaS  vendors,  which  leads  to  less  flexibility. Figure 2.4 describes the implementation of SaaS. 

 

End User

 

Figure 2.4 Software as a Service  

As  the  infrastructures  are  transparent  to  SaaS  customers,  the  service  fees  are  no  longer based on performance usage, but “per user per month”. A practical example  of SaaS products is IBM LotusLive. [Pij09] 

 

To  summarize,  SaaS  is  a  kind  of  “scalable,  available,  multi‐tenant  supported  and  configurable  software  deployed  as  a  hosted  service  and  accessed  over  the  Internet.”[Ley09] 

 

2.3 Economics of Cloud Computing

In the last Section we have discussed about three different implementation levels of  Cloud  Computing.  Then  we  will  concern  with  the  choice  of  three  levels  of  Cloud  Computing for enterprise and the Service Level Agreement (SLA) between customer  and vendor. 

(11)

2.3.1 The Alternative of Cloud Computing in Enterprise

In the business economics area, the implementation of Cloud Computing is a kind of  Internet‐based  IT  outsourcing.  The  requirements  of  network  infrastructures  for  traditional IT outsourcing are only limited to the capability of guarantee the efficient  communication  and  cooperation  between  customer  and  vendor  through  e.g.  email  and  video  conference,  which  is  too  far  away  from  the  requirements  for  Internet‐based IT outsourcing – Cloud Computing. 

 

Public Cloud and private Cloud are two kinds of Cloud Computing. The private Cloud  is “a marketing term for a proprietary computing architecture that provides hosted  services  to  a  limited  number  of  people  behind  a  firewall”  [PriCL].  As  the  private  Cloud  is  built  within  enterprises,  the  IT  infrastructure  for  building  private  Cloud  is  required. The public Cloud services are provided and delivered through Internet. The  enterprises  do  not  need  to  build,  but  substitute  and  receive  services.  The  combination  and  data  exchange  between  private  Cloud  and  public  Cloud  could  be  implemented via VPN.    No matter which kind of Cloud services the enterprises prefer, they have to choose a  suitable Cloud Computing implementation level. In this paper, we focus on the public  Clouds.    At the level of IaaS, there is no need to purchase or maintain the IT infrastructure.  This  part  of  fixed  costs  turns  to  a  variable  cost,  which  is  used  to  pay  service  fees.  However,  enterprises  have  to  purchase  the  operation  system,  application  software  and their licenses. Additionally, they also have to pay a lot to hunt IT experts, who  have to be taken care of in order to prevent the huge lost from their leaving. 

 

At  the  level  of  PaaS,  enterprises  can  use  some  Cloud  services  like  database  and  operation  system  provided  by  service  vendors  in  addition  to  the  IT  infrastructures.  Compared to the IaaS level, enterprises can save some money for operation system  and some general software provided by PaaS  vendors. But enterprises still have to  purchase  some  special  application  software,  which  are  not  provided  by  service  vendors. The enterprises have to hunt IT experts as well. 

 

At the level of SaaS, which is the top level of Cloud Computing implementation, SaaS  vendors  provide  a  standard  solution  suit  including  software,  hardware  and  applications. Enterprises do not need to spend money on any software, hardware or  IT experts, as they are the end user to SaaS vendors. The only cost is SaaS‐fee, which  is  based  on  “per  user  per  month”.  At  this  level,  the  IT  cost  of  the  enterprise  is  minimized. Without hardware or software maintenances, the enterprises can totally  focus on their key business area. 

 

But at no matter which level of Cloud Computing implementation, the enterprise has  to  face  the  risks  like  the  security  of  business  data,  the  suspension  of  outsourcing 

(12)

2 Cloud Computing  contract, the bankrupt of the service vendor etc. 

 

2.3.2 Service Level Agreement (SLA)

After  the  selecting  phase  of  Cloud  Computing  vendors,  the  enterprises  will  sign  an  outsourcing contract, which contains for example the contract of service, contract of  purchase, contract for work and labor etc, with the service vendor. The SLA, which is  “a  negotiated  agreement  between  two  parties  where  one  is  the  customer  and  the  other  is  the  service  provider”,  [SLA]  plays  a  significant  role  in  the  outsourcing  contract. 

 

SLA records the agreements of QoS (Quality of Service), which contain for example  performance,  availability,  storage  capacity  and  reaction  time,  between  both  sides.  They  are  measured  by  numbers  such  as  Time  Service  Factor  (TSF),  which  is  the  percentage  of  the  service  reaction  time  within  an  agreed  timeframe,  Turn  Around  Time (TAT), which is the time to accomplish some task. 

 

SLA  management  is  normally  divided  into  two  phases:  negotiation  phase  and  monitoring  phase.  In  the  negotiation  phase,  the  customer  and  vendor  define  the  concrete  service  level,  while  in  the  monitoring  phase  the  customer  monitors  the  fulfillment  of  the  contract  in  the  runtime.  “It  is  important  to  note  that  the  “agreement” relates to the services the customer receives, and not how the service  provider delivers that service.” [SLA] 

 

2.4 Advantages and Risks

After  the  introduction  of  Cloud  Computing,  let’s  turn  to  the  benefits  brought  from  Cloud  Computing  and  the  risks,  which  should  be  taken  care  of  by  vendors  and  customers. 

 

2.4.1 Advantages

The  IT  operation  cost  will  be  strongly  reduced.  The  capital  expenditure  turns  to  operational expenditure, which is better to manage and makes the cash flow more  visible.  It  saves  the  cost  not  only  for  purchase  of  IT  infrastructure,  but  also  for  hunting IT experts and training staffs. 

 

With  Cloud  Computing,  the  deployment  of  new  applications  has  been  extremely  speeded  up.  As  for  SaaS,  a  short  time  staff’s  training  of  the  application  is  enough,  while  the  in‐house  development  takes  a  long  development  life  cycle,  which  raises  the risks and costs. 

 

(13)

to solve the technical problem quickly and efficiently. Furthermore, they may have  some  successful  cases  to  reference  and  can  give  a  lot  of  useful  suggestions  to  customers. So the reliability has been improved. 

 

How could the scalability be easily realized by an IT in‐house development enterprise?  The  enterprise  could  purchase  new  hardware  or  update  the  available  hardware  to  meet the needs of new requirements. But what would happen if the enterprise finds  they  do  not  need  so  much  IT  power?  They  could  not  just  abandon  the  spare  IT  resources. Cloud Computing will solve this problem easily. The service fees paid by  the enterprise decide the capacity of services received, which makes the dynamically  changing of their IT resources possible. 

 

The  security,  which  is  most  important  for  enterprise,  has  been  improved  by  Cloud  Computing. Imaging how easily is it to steal a 2kg weighted laptop than an over 10kg  weighted server? It is too dangers for an IT expert of an in‐house enterprise to leave  his laptop, which may contain a lot of sensitive data, in his car, as there are too many  security problems caused by stolen laptops. Even though the enterprise may build a  room for their servers, the servers may be touched by some non IT experts. But as  for  the  service  provider,  the  situation  is  totally  different.  They  provide  higher  data  security to attract new customers via building huge room or even a whole building  for  their  servers,  mainframes  and  super  computers.  They  invest  a  lot  to  keep  their  hardware  and  software  safe,  which  might  be  an  impossible  mission  for  a  middle  enterprise. 

 

Besides  these  advantages,  there  are  still  a  lot  of  other  benefits  brought  by  Cloud  Computing like easier maintenance, metering etc. 

 

2.4.2 Risks

Although  the  Cloud  Computing  brings  so  many  advantages,  the  popularity  is  still  queried by enterprises. Enterprises may have the following trepidations. 

 

Almost all of the enterprises are worried about their sensitive data. They think the  data is safe, only if the data is stored within the enterprise and can be touched by  them  anytime.  Just  imaging  a  middle  enterprise,  which  is  reasonable  to  deploy  a  middle level database to secure and administrate the sensitive data. But how could  this  middle  level  database  offer  a  higher  level  security  mechanism  as  large  level  databases  like  Oracle, DB2,  which  are  usually used  by  service  vendors?  Enterprises  also  worry  that  the  service  provider  might  pass  their  sensitive  data  to  their  competitors. In order to solve the problem, private Cloud, which stores enterprises’  sensitive data within enterprises, turns up. Thank private Cloud enterprises not only  acquire a higher level of security but also keep their sensitive data under control.   

(14)

2 Cloud Computing  advantages.  Those  advanced  processes  may  be  passed  to  other  competitors  by  service vendor. Business Process Reengineering (BPR) is one of the solutions for this  problem.  The  enterprise  separates  those  non  value  added  chains  and  uncritical  processes from the whole business process, outsources these separated processes to  service  vendor,  so  that  they  will  not  give  out  their  competitive  advantages.  At  the  mean time, they can also focus on the key fields of business. 

 

As  a  new  solution  for  enterprise,  there  are  too  few  successful  cases.  A  stable  enterprise  may  not  take  this  risk.  The  enterprises  may  ask,  what  happens  if  the  service vendor goes bankrupt? Who will be in charge of the contract obligation?   

Enterprises  also  have  to  consider  the  cost  for  the  transform  from  in‐house  to  outsourcing. In this transform phase, the cost may be huge. The enterprises have to  take  the  risk  of  not  only  the  corporate  culture  changing,  but  also  the  lost  of  IT  experts or some key persons. 

 

It is also difficult to choose a proper service vendor. A wrong choice may cost a lot.  For  example,  could  a  service  vendor  with  American  corporate  culture  deliver  efficient  and  reliable  services  to  a  German  traditional  family‐based  corporation?  Is  not the cultural gap between them influence the cooperation? And also enterprises  have to consider, where to store their data, in their own country or other countries.  What happens if the local law is deferent? 

 

2.5 Component-Based Application Design

The  component‐based  application  design  has  played  a  significant  role  in  software  engineering  area,  through  which  the  software  development  can  reduce  cost  and  shorten  the  development  life  cycle.  “A  component  framework  defines  a  semi‐complete  software  architecture  that  has  been  carefully  parameterized  with  respect to the components that represent the most variable elements of the domain.  A  component‐based  application  can  thus  be  instantiated  from  the  component  framework  by  simply  providing  the  specific  components  needed  for  the  particular  application.” [TVJ+] 

 

There are several different component systems based on various platforms like J2EE  and Microsoft .NET, which are the two most popular candidates for Cloud Computing.  In  SaaS,  the  services  provided  by  the  vendors  can  be  considered  as  a  huge  internet‐based  application,  which  contains  a  lot  of  component‐based  applications.  The  communication  between  these  applications  may  be  through  message  mechanism, which is based on Web Services protocols like SOAP, WSDL, and UDDI.  When  the  service  vendors  establish  new  service,  the  new  service’s  UDDI  will  be  stored in a candidate list. If requestor requires some special service, he will first send  the  service  description  to  the  service  discovery  facility.  After  finding  out  the 

(15)

favorable service, the requestor will get the service address, which may be described  in  WSDL.  The  requestor  now  can  reference  the  service  via  service  address.  The  component  based  application  design  can  make  the  Cloud  Computing  to  provide  scalable services efficiently and accurately. 

(16)

3 Composite Application Framework 

3 Composite Application Framework

3.1 Introduction

The  term  Composite  Application  Framework  has  not  been  standardized.  The  enterprise  has  its  own  definition  for  Composite  Application.  SAP  thinks  that  “Composite Applications are user centric applications supporting highly collaborative  and  dynamic  business  processes  which  span  several  functional  areas  across  and  beyond  organizations”  [SAP].  Microsoft  defines  Composite  Application  as  “a  collection  of  software  assets  that  have  been  assembled  to  provide  a  business  capability.  These  assets  are  artifacts  that  can  be  deployed  independently,  enable  composition, and leverage specific platform capabilities” [Bar06]. 

 

From the perspective of end‐user, Composite Application is a standalone application.  It can be adapted in a relative short time; it does not care of the organization and  system boundary but fully utilizes the existing resources; its user interface changes  rarely,  although  the  back‐end  system  has  been  totally  revised.  From  the  technical  perspective,  the  Composite  Application  is  a  collection  of  existing  services  and  components,  which  aligns  existing  IT  infrastructures  with  the  requirements  of  end‐user.  Furthermore,  it  realizes  loosely  coupling  between  user  interface  and  back‐end system. 

 

3.2 Features of Composite Application Framework

Composite Application Framework has the following features.   

Heterogeneous  services,  applications  and  components  should  behave  as  a  standalone  application  in  the  framework.  From  the  perspective  of  end‐user,  the  whole  Composite  Application  acts  as  a  simple  and  standalone  application.  There  is  no  need  to  search  a  certain  application  interface  to  accomplish  a  certain  task.  As  end‐user’s  opinion,  the  Composite  Application  might  be  just  a  web  browser  based  user interface, which means that the system is transparent to end‐user. This feature  is similar to the Cloud Computing introduced in Chapter 2. 

 

The  services,  applications  and  components,  which  compose  the  Composite  Application  within  the  framework,  are  loosely  coupled.  When  the  requirements  of  enterprise  change,  the  services,  applications  and  components  can  be  easily  added,  removed  or  modified  with  no  influence  to  others.  Furthermore,  these  services,  applications,  components  and  computing  assets  are  reusable.  The  loose  coupling  leads to the independence between front‐end user interface and back‐end system.   

(17)

In the framework, the components are capable of communicating with each other. In  the  Web  Services  architecture,  the  communication  could  be  achieved  by  different  Message  Exchange  Patterns  (MEPs),  which  are  explicitly  defined  in  WSDL  2.0  including  In‐Only  MEP,  Robust  In‐Only  MEP,  In‐Out  MEP,  In‐Optional‐Out  MEP,  Out‐Only MEP etc. 

 

The  framework  should  support  transactional  application,  which  gets  data  from  multiple components and sources. 

 

Besides these features, the framework should provide security mechanisms such as  role  control  and  authentication;  integrate  different  applications  in  a  single  user  interface and provide a uniform Graphical User Interface etc. 

 

3.3 Cafe Project

3.3.1 Introduction

“Cafe (Composite Application Framework) is a methodology, architecture and a set  of  prototypes  that  aims  at  modeling,  provisioning  and  executing  composite  applications in the Cloud” [Miet]. The project is part of the ongoing PHD work from  Ralph Mietzner at University of Stuttgart. 

 

The architecture of Cafe is similar to SaaS application, which has been discussed in  the  Chapter  2.  In  the  traditional  SaaS  application,  the  IT  infrastructures  and  applications  are  provided  by  the  same  application  vendor.  That  is  to  say,  the  IaaS,  PaaS and SaaS belong to a unique application vendor. Customers can subscribe the  standard  SaaS  application  services  provided  by  the  application  vendor.  Generally  a  standard  application  cannot  satisfy  all  customers,  therefore,  the  customization  has  to be issued by costumers. Some customers have its own IT  department to handle  the customization, while the others choose outsourcing. The deployment by a third  IT consulting company is expensive. Customers have to pay the subscription fees as  well as deployment fees, which stupendously increase the IT cost. Furthermore, the  deployment  by  the  third  IT  consulting  company  is  risky  and  requires  long  deployment life cycle, as the consulting company is neither the application services’  provider nor the receiver of application services. 

 

Cafe architecture raises a new framework to separate the application vendor and the  application  provider.  The  Cafe  application  vendor  is  in  charge  of  supplying  IT  infrastructures  and  standard  Cafe  application.  The  application  provider  purchases  the  standard  Cafe  application,  whose  artifacts  are  packaged  as  a  Cafe  application  archive (.car) file, from application vendor. The application provider customizes the 

application  according  to  the  specified  requirements  of  customers.  The  services  subscribed by a certain customer are totally customized, so that the customer does 

(18)

3 Composite Application Framework  not need to establish his own IT department or ask the third consulting companies to  customize the application services. Compare to the traditional SaaS, the customers  only  need  to  pay  the  subscription  fees  for  specific  services,  which  makes  the  deployment  much  more  quickly.  As  for  the  redeveloper  of  application  services  so‐called application provider, the development life‐cycle of customization is relative  short.  The  application  provider  could  improve  his  application  by  learning  from  the  customer’s  requirements,  and  turns  these  improvements  to  his  competitive  advantages. 

 

Figure 3.2 describes the implementation of from service vendor to service provider  delivered application service example. The GUI Component acts as a user interface  and runs above the JBOSS App Server. The Component can be accessed by user via  URL,  while  the  Workflow  Component  provides  EPR  address  for  invoking  specified  business  process  and  returns  the  result  back.  Finally,  the  data  generated  by  Workflow  Component  presents  on  the  GUI  Component.  Figure  3.1  simplifies  the  diagram by using Compartment’s Collapsible attribute. 

 

The  task  of  this  paper  is  to  describe  how  to  develop  the  graphical  editor,  which  supports  the  easily  drawing  of  Figure  3.1  and  Figure  3.2,  generates  the  Cafe  application  descriptor  with  Eclipse  Graphical  Modeling  Framework  (GMF),  and  exports the corresponding .car file by Eclipse Plug‐In Development Environment. 

 

  Figure 3.1 Collapsed Example of Cafe Application

(19)

 

Figure 3.2 Extended Example of Cafe Application

 

3.3.2 Editor for Application Vendor

In  Figure  3.3  displayed  Ecore  diagram  shows  us  the  meta‐model  of  the  editor  components. 

(20)

Figu   In t and Com   The Com Figu   Figu ure 3.3 Ec he applicat d acts as the mponents.  e  Componen mponents,  ure 3.4 show ure 3.4 Co core Meta-M ion descrip e root of the nt  Depende whose  sou ws the exam omponent D Model of C ptor, the Ap e meta‐mod ency  named rce  is  Visib mple of Com Dependenc Cafe Applic pplication Te del. It conta d  as  Relatio ble  Propert mponent De cy 3 cation emplate is  ains arbitrar

on  in  the  m ty  and  the ependency.  Composite Ap the canvas  ry amount o meta‐mode   target  is  plication Frame in the diag of Relations l  connects  variability.  ework    gram   and  two  The   

(21)

 

Component  is  an  important  part  of  the  diagram.  There  are  three  different  Component  Patterns,  Single  Instance,  Single  Configurable  Instance  and  Multiple  Instances, which are distinguished by different icons in the diagram and displayed in  Figure 3.5. 

 

 

Figure 3.5 Component Patterns  

For  different  customers,  parts  of  their  requirements  are  identical.  For  example,  almost  every  international  commercial  company  needs  the  direct  quotation  of  exchange rate. This kind of Component can be set as a Single Instance Component,  which  provides  the  same  information  to  all  customers.  It  does  not  need  to  know  which  subscriber  is  invoking.  Therefore  no  specific  configuration  is  needed.  The  provider needs to deploy it only once. The update can be applied to all customers,  who  subscribe  this  Component  service.  Furthermore,  the  same  Single  Instance  Component  can  be  deployed  multiple  times.  The  subscription  and  invoking  is  controlled by load balancer proportionately. 

 

If customers need the specific subscription, the application provider should provide  the  customer  specific  Component,  which  is  supported  by  Single  Configurable  Instance  Component.  The  Component  is  aware  of  every  subscriber  and  provides  configured  services.  For  example,  the  service  fees  calculation  Component  sends  customer  specific  invoice  monthly  according  to  the  contract.  Generally,  the  Single  Configurable  Instance  Component  needs  to  be  deployed  only  once.  Adding  new  subscription  does  not  cause  the  redeployment,  while  the  updating  causes  the  redeployment.  The  same  as  Single  Instance  Component,  one  Single  Configurable  Instance Component can be deployed multiple times. The subscription is handled by  load balancer as well. 

 

Sometimes  the  provider  needs  to  change  the  Single  Instance  Component  to  Single  Configurable Instance Component, which results in the redesign of the Component  and  the  reboot  of  the  system.  To  reduce  the  cost  and  increase  the  availability,  Multiple  Instances  Component  turns  up.  The  specific  instance  is  deployed  to  each  customer, so that there is no influence to the other running Components by adding  new Component. As the relationship between instance and customer is one to one,  the load balancer is no more necessary. 

 

The  running  of  some  Components  depends  on  the  environment  provided  by  other  Components.  In  order  to  express  this  kind  of  dependence,  Deployment  Relation  is 

(22)

intr Figu   Figu   Eve the  Imp prog of  F imp We proc cou Imp   Figu oduced.  It  ure 3.6.  ure 3.6 De ry  Compon Impleme plementatio gramming l File  attribut plement  the b  Applicatio cess. If the  ld be empt plementatio ure 3.7 Im expresses  eployment ent  is  impl entation  a on,  whose  languages l tes  contain e  Compone on  while  th Implement ty. The Figu ons.  plementati the  relatio Relation emented  th attribute.  type  mig ike Java, BE ning  the  pa ent.  For  exa he  WSDL  a tation type  ure 3.7 show ions onship  amo hrough  vari Each  Com ght  be  pr EPL, C#. The ath  of  refer ample,  the  and  BPEL  fi is provider  ws the diffe 3 ong  Compo ious  metho mponent  r rovider  su e implemen renced  com WAR  file  is les  are  use supplied or erent kinds  Composite Ap nents,  whic ods,  which  a requires  a pplied,  ex ntation is re mponents  o s  used  to  i ed  to  imple

r external, i  of Compon plication Frame ch  is  show are  specifie at  least  xternal  or  ealized by a or  files  use

mplement  ement  busi ts File attrib nents and t ework  wn  in    ed  in  one  the  a set  d  to  Java  ness  bute  their   

(23)

  The Dep (EPR not  prov Pro Figu   Figu   The Com calle and attr   Figu e Componen ployment Re R)  provides only  the  a vides the a perty and i ure 3.8 show ure 3.8 Vis e  applicatio mponent to  ed Service L d  the  numb ributes. Figu ure 3.9 Re nt can be a elation but  s  the  access address  and ccess interf ts Element  ws the exam sible Prope on  vendor  his custom Level Agree er  of  concu ure 3.9 show equirement ccessed by also other  s  interface  d  port  of  t face for dat attribute, w mples.  erty not  only  mer, the app ement (SLA) urrent  user ws the exam ts y other Com flexible way for  Web  Se the  databas tabase. In d which cont provides  t plication pro ) between t s  etc.,  whic mple for Req mponent thr ys. For exam ervice  while se  but  also diagram the ains the co the  implem ovider, but  them. It con ch  are  cont quirement.   rough not o mple, End P e  the  URL,  o  the  login  ey are descr oncrete acce mentation  also fulfills  ntains versi tained  in  th only a so ca Point Refere which  cont and  passw ribed by Vis ess descript and  access the contrac ion, availab he  Requirem alled  ence  tains  word,  sible  tion.    s  of  ct so  bility,  ment 

(24)

3 Composite Application Framework   

The last component in the diagram is Variability. It acts as the source of Component  Dependency,  which  describes  the  relationship  between  Components  and  has  been  displayed in Figure 3.4. 

 

3.3.3 CAR: Cafe Archive File

The diagram together with the generated XML description file and the files appeared  in  Implementation  attributes  should  be  packaged  as  a .car  file,  which  acts  as  a 

configuration  file  sent  from  application  vendor  to  application  provider.  The  implementation  of  generating .car  file  is  through  the  extension  of  Export  Wizard 

Extension  Point  in  Eclipse  Plug‐In  Development  Environment,  which  will  be  introduced in details in Chapter 5. 

(25)

4 Eclipse Modeling Projects and Plug-In

4.1 Introduction and Background

4.1.1 Eclipse

The  original  meaning  of  Eclipse  is  “an  astronomical  event  that  occurs  when  one  celestial object moves into the shadow of another.” [Ecl]. When IBM chose “Eclipse”  to  name  its  new  Java  Integrated  Development  Environment  (IDE),  it  was  directly  targeting the Microsoft’s Visual Studio and Sun Microsystems’ Sun One Studio. After  a nine‐year development, Eclipse became one of the most popular IDEs in the Open  Source  Community  not  only  for  Java  but  also  for  C,  PHP  and  other  programming  languages. 

 

According  to  the  official  definition,  “Eclipse  is  an  open  source  community,  whose  projects  are  focused  on  building  an  open  development  platform  comprised  of  extensible  frameworks,  tools  and  runtimes  for  building,  deploying  and  managing  software across the lifecycle.” [Ecli] 

 

4.1.2 Model-Driven Software Development (MDSD)

Generally, talking about the modeling diagram, the UML (Unified Modeling Language)  and the diagrams drawn with UML come into our mind. A lot of development teams  have  increased  productivity  and  quality  by  introducing  the  Model‐Driven  Software  Development. 

 

Before  using  the  Model‐Driven  Development  (MDD),  a  Model‐Driven  Architecture  (MDA),  which  is  “a  software  design  approach  for  the  development  of  software  systems”  [MDA],  has  to  be  built  firstly.  The  MDA  includes  defining  Platform  Independent  Model  (PIM),  determining  the  target  platform,  defining  the  transformation  and  applying  the  transformation  either  manually  or  automatically.  Thank MDD, software development now turns to a model transformation. All of the  models  are  independent  with  each  other  and  separately  defined.  Each  transformation is from an abstract level to a less abstract or concrete level, until a  target system implementation is reached.    The EMF (Eclipse Modeling Framework) and GMF (Graphical Modeling Framework),  which will be introduced later, are the implementations of OMG modeling standards.  Therefore, the development of the graphical editor with GMF is based on MDSD.   

(26)

4 Eclipse Modeling Projects and Plug‐In 

4.1.3 The Eclipse Modeling Project

Eclipse  Modeling  Project,  which  is  a  relative  newer  top‐level  project  in  the  Eclipse  Community,  aims  to  improve  and  widespread  MDSD  technology  within  the  Eclipse  Community.  It  provides  the  following  capabilities:  Abstract  Syntax  Development,  Concrete  Syntax  Development,  Model  Transformation  and  the  latest  started  Modeling  Amalgamation  Project  (Amalgam),  which  “provides  improved  packaging,  integration, and usability of Modeling project components” [EclMP]. 

 

Abstract Syntax Development includes the core project of Eclipse Modeling Project –  Eclipse Modeling Framework (EMF), which has been existed since the appearance of  Eclipse  platform.  EMF  provides  Model  Transaction  component,  Model  Validation  framework,  Model  Query  component  and  Model  Search  component  etc.  It  also  “supports  the  definition  of  abstract  syntax  for  modeling  languages  like  Object  Constraint Language (OCL) and Unified Modeling Language (UML)” [EclMPC]. 

 

Within  Concrete  Syntax  Development  it  contains  Graphical  Modeling  Framework  (GMF) “providing a generative component and runtime infrastructure for developing  graphical editors based on EMF and GEF” [EclMP] and Textual Modeling Framework  (TMF)  “providing  tools  and  frameworks  for  developing  textual  syntaxes  and  corresponding  editors  based  on  EMF”  [EclMP].  With  GMF  we  can  generate  a  powerful graphical editor, while with TMF we can create a high quality textual editor.  In this paper we focus on the GMF. 

 

Using  Model‐to‐Model  Transformation  (M2M)  and  Model‐to‐Text  Transformation  (M2T)  projects  we  can  generate  a  user‐defined  graphical  or  textual  editing  environment.  Within  the  M2M  project  the  M2M  rules  can  be  defined  to  generate  another model from already existed instance models, while within the M2T project  the M2T rules can be defined to generate the requested text template. 

 

4.2 Eclipse Modeling Framework (EMF)

“The EMF project is a modeling framework and code generation facility for building  tools  and  other  applications  based  on  a  structured  data  model”  [EMF].  It  helps  programmer  to  generate  Java  code  from  user‐defined  models  automatically.  The  generated Java code can be modified and edited just like other normal Java code. For  example, the user‐defined methods and variables can be added. When the Java code  has  to  be  regenerated  caused  by  model  changing,  the  user‐defined  methods  and  variables will not be overwritten using Java annotations. The model can be stored as  an  XML  file,  which  has  been  widely  used  as  a  standard,  so  that  the  capability  of  model  interchange  is  quite  easy.  On  the  contrary,  the  model  can  be  created  by  annotated Java code or XML. 

 

(27)

decorator  model  for  the  Ecore  Model”  [EMFfaq],  is  used  to  define  or  control  the  generation process. EMF provides the following key functions: EMF (Core), Compare,  Model Query and Validation Framework. 

 

4.2.1 EMF (Core)

EMF  contains  the  following  three  fundamental  parts:  EMF,  EMF.Edit  and  EMF.Codegen.    Within the core EMF framework, Ecore is used as a meta‐model to describe model  and the runtime environment. The details and the creation of Ecore will be discussed  in Chapter 5.   

EMF.Edit  framework  provides  an  easy  understanding  graphical  editor,  where  the  model  is  modified.  In  the  meantime,  the  stored  XML  file  is  also  modified  synchronously.  Using  command  stack  makes  the  editor  to  support  the  automatic  undo and redo. 

 

EMF.Codegen  facility  is  able  to  generate  the  Java  code  to  build  the  EMF  model  editor. 

 

4.2.2 Compare

EMF Compare “brings model comparison to the EMF framework, this tool provides  generic support for any kind of meta‐model in order to compare and merge models”  [EMF]  Moreover,  it  also  provides  the  following  different  compare  methods:  a  Standalone Core providing a jar‐based comparison independent of Eclipse runtime,  Team Providers Integration with SVN, CVS or GIT, Extensible Framework developed  by Eclipse Plug‐in facility. 

 

4.2.3 Model Query

The  query  component  “facilitates  the  process  of  search  and  retrieval  of  model  elements  of  interest  in  a  flexible  yet  controlled  and  structured  manner”  [EMF].  Model Query provides the SQL‐like query methods.  The SELECT class accesses the 

set of models iteratively, collects the result set according to the query conditions to 

QueryResultSet object and then returns the QueryResultSet to the caller. The  FROM  class  determines  or  limits  the  search  area  and  provides  an  iterator  for 

elements  in  the  search  area.  The WHERE  class  restricts  the  query  conditions.  The  UPDATE  class  is  similar  to  the  SELECT  class,  and  additionally  provides  the 

modification  function. QueryResultSet  class  is  used  to  store  the  result  sets  and 

return  them  to  the  caller.  Moreover,  Model  Query  provides EObjectCondition 

class,  ConditionPolicy  class  and 

(28)

4 Eclipse Modeling Projects and Plug‐In   

4.2.4 Validation Framework

Validation  Framework  provides  batch  and  live  validating  methods.  The  validation  process  can  be  either  explicitly  executed  after  the  modification  of  models  or  implicitly  and  live  invoked  during  the  modifying  of  models.  The  implicit  validation  needs a validation listener to monitor the validation events.    Within the Validation  Framework, the programmer can define various constraints with either Java or OCL.   

4.3 Graphic Editing Framework (GEF)

4.3.1 Introduction

After creating the meta‐model through EMF and generating our user‐defined model,  a  graphical  editing  environment  is  needed  to  simplify  the  model  development.  A  general problem is how to reflect the modification in graphical editor to the model  description file synchronously. For  example, when editing the graphical description  of  BPMN  in  a  graphical  editor,  the  corresponding  XML  schema  should  also  be  changed  synchronously.  Model‐View‐Controller  (MVC)  is  one  of  the  most  popular  solutions used in GEF. 

 

“The Graphical Editing Framework (GEF) allows developers to create a rich graphical  editor  from  an  existing  application  model.  It  consists  of  2  Plug‐ins.  The  org.eclipse.draw2d  plug‐in  provides  a  layout  and  rendering  toolkit  for  displaying  graphics.  GEF  employs  an  MVC  architecture  which  enables  simple  changes  to  be  applied to the model from the view” [GEFWiki]. 

 

4.3.2 Model-View-Controller (MVC)

Model‐View‐Controller  (MVC)  is  “a  software  architecture,  currently  considered  an  architectural pattern used in software engineering. The pattern isolates domain logic  (the  application  logic  for  the  user)  from  input  and  presentation  (GUI),  permitting  independent  development,  testing  and  maintenance  of  each”  [MVC].  In  MVC  architecture,  Model  acts  as  back‐end,  which  provides  the  operation  of  application,  the generated front‐end View is generally represented by a GUI, which presents the  back‐end  Model  with  various  graphics  or  other  ways.  The  Controller  accepts  the  input from Viewer; passes it to the back‐end model and then returns the results to  Viewer. 

 

The  following  description  is  about  the  MVC  control  flow.  The  user  changes  the  Viewer  in  UI  through  e.g.  mouse  click.  The  Controller  listens  the  UI  event  and  handles  the  input  event.  After  converting  the  event  to  a  Model  understandable  access, the Controller passes the converted event to back‐end Model. The Model will 

(29)

do  some  corresponding  operations  and  notify  the  Viewer  through  Controller.  The  modification  will  be  represented  in  the  UI.  Through  the  decoupling  of  Model  and  View,  which  increases  the  reusability  of  code,  the  complexity  of  Model  and  View  design has been reduced. 

 

4.3.3 Draw2D

Within the GEF editor, the elements like figure, text, layout and connection drawn by  user are provided by org.eclipse.draw2d plug‐in package. 

 

Before  painting  figure,  the  paint()  method  will  do  some  initializations  like 

preparing  the  font,  foreground  and  background  color.  After  the  initialization,  the 

paintFigure()  method  is  called  to  paint  figures.  In  case  the  child  figures  are 

needed, the paintClientArea() method, which sets up a specified area for child 

figures, has to be invoked. Any operation on child figures is not allowed to    beyond  this  area.  After  setting  up  the  specified  area,  the paintChildren()  method  is 

invoked  to  paint  child  figures.  Finally,  the paintBorder()  method  is  called  to 

specify  the  border  of  the  figures.  The  child  figure  is  not  allowed  to  exceed  its  parent’s  border.  Otherwise,  the  exceeded  parts  have  to  be  cut  off.  During  the  painting,  we  can  use  org.eclipse.draw2d.label  and  org.eclipse.draw2d.text package to add label or text. 

 

After  painting  the  figures,  the  layout  setting  is  checked.  If  layout  is  used,  the  implementation of layout is divided into two steps. Firstly, all figures will be marked  as “invalid”. Secondly all these marked figures will be validated. During the validation,  the information like minimum, maximum and preferred size, position etc. has to be  proved.  If  the  figure  is  modified,  these  two  steps  of  validation  have  to  be  reprocessed. 

 

Draw2d also provides connection figure, which is a special figure. Connection figure  aims  to  connect  other  figures  from  various  child  areas.  Therefore,  the  border  of  connection figure is not defined.    4.3.4 GEF In MVC architecture, draw2d provides View with figures and connections while the  Ecore in EMF provides the meta‐model for different GEF models. These models can  be written in various formats like Java code, XML Schema. The Controller function is  provided  by  GEF  EditPart,  which  provides  a  bridge  between  View  and  Model.  It  converts user interacted events in UI to model understandable commands and then  sends  them  to  model,  so  that  the  model  modifications  can  be  implemented  according  to  the  UI  events.  And  vise  vase,  the  modifications  in  Model  can  be  reflected to the UI Viewer. 

(30)

4 Eclipse Modeling Projects and Plug‐In  Converting the model to our user‐defined view is relative simple. It is usually realized  by adding listeners, which invoke the refresh operation on the view. But converting  the  UI  events  to  model  is  much  more  complex.  As  soon  as  the  modifications  take  effect, a request is generated to require the interface and commands, which are in  charge of the modifications, in the model. At the same time the edit policies are set.  The detailed interaction of this process is beyond this paper. We will not expend it  here. 

 

4.4 Graphic Modeling Framework (GMF)

4.4.1 Introduction

Compared  with  GEF  project,  GMF  project  is  fresher  and  “provides  a  generative  component  and  runtime  infrastructure  for  developing  graphical  editors  based  on  EMF and GEF. It aims to provide these components, in addition to exemplary tools  for  select  domain  models  which  illustrate  its  capabilities”  [GMF].  GMF  is  based  on  MVC architecture and separates the diagram and domain model, which increases the  productivity and quality. 

 

During  GMF  development,  programmer  uses  Ecore  to  describe  meta‐model.  According  to  the  description  in  Ecore,  the  model,  edit,  editor  and  tests  codes  are  automatically generated by EMF Generator Model. In addition, GMF UI also extends  the org.eclipse.draw2d package. 

 

4.4.2 Graphical Modeling Framework Tooling

“The GMF Tooling consists of editors to create/edit models describing the notational,  semantic and tooling aspects of a graphical editor as well as a generator to produce  the implementation of graphical editors” [Pla06]. 

 

After  generating  the  model,  edit  and  editor  codes,  the  Graphical  Definition  Model,  which  contains  the  root  element  canvas,  can  be  created.  There  are  five  kinds  of  element in canvas, which are Figure Gallery, Node, Diagram Link, Compartment and  Diagram Label.    Each Figure Gallery has several Figure Descriptors. Under Figure Descriptor one kind  of Figure Shapes, e.g. rectangle, rounded rectangle, ellipse, polyline, template point,  polyline connection and custom figures etc., can be added. Dimension, layout, label,  border  and  color  are  stored  as  shape’s  attributes,  which  can  be  setup  separately.  Finishing  the  setting  of  Figure  Gallery,  the  Node  element  can  be  added  and  references the corresponding Figure Descriptor. If the label attribute has been set in  the Figure Shape, a Diagram Label element need to be added and linked with it. The  Diagram Link is used to associate with the connection figure in the Figure Descriptor, 

(31)

while the Compartment is usually contained within other figure.   

After the editing for Graphical Definition Model, the Tooling Definition Model, which  is relative simple, need to be created. It defines the elements, the name of elements,  and  the  icon  of  elements  in  editor  palette.  The  order  of  elements  in  Tooling  Definition Model determines the order of the elements in palette. 

 

The  fundamental  working  stage  is  accomplished  now.  Next  step  is  to  create  a  Mapping Model, which is the heart of GMF models and represents a diagram. In the  Mapping Model there are Canvas Mapping, Top Node Reference and Link Mapping.   

Canvas  Mapping  defines  the  domain  model,  element,  palette,  diagram  canvas  etc.  which  link  the  already  generated  Ecore  Model,  Graphical  Definition  Model  and  Tooling Definition Model. 

 

Top  Node  Reference  indicates  the  figures,  which  can  be  directly  displayed  on  the  diagram  surface.  It  links  Diagram  Node  and  Tool  through  its  Node  Mapping  child  element.  If  there  is  any  child  figure  so‐called  compartment  within  it,  a  Child  Reference  is  needed,  and  the  Compartment  Mapping  is  used  to  map  the  corresponding  Compartment  in  the  Graphical  Definition  Model.  Moreover,  the  Constraint,  which  is  written  in  Object  Constraint  Language  (OCL)  or  Java,  can  be  defined. Its tasks include element initialization, link constraint, audits etc. 

 

As  for  the  Connection  figure,  a  Link  Mapping  is  specified  to  build  the  relationship  between Diagram Link and Tool. The source and target have to be set explicitly.   

The Generator Model, which provides the largest model in GMF, is generated based  on the Mapping Model and Ecore Model. 

 

4.4.3 Graphical Modeling Framework Runtime

“The  generated  plug‐in  depends  on  the  GMF  Runtime  component  to  produce  a  world  class  extensible  graphical  editor”  [Pla06].  GMF  runtime  provides  a  set  of  reusable  components  such  as  toolbar,  palette,  diagram  menu,  connection  handles,  pup‐up  bars,  outline  view,  diagram  export  to  image  files  etc.  It  also  supports  the  bridging  of  EMF  and  GEF.  The  service  provider  infrastructure  and  extensibility  options provide the interface to develop new runtime components based on Eclipse  Plug‐In  Development  Environment  via  ExtensionPoints.  Details  of  GMF  runtime  components will be introduced with examples in Chapter 5. 

 

4.4.4 Beyond GEF and EMF

GMF  is  not  only  the  name  combination  of  GEF  and  EMF,  but  also  a  functional  combination of both, which provides higher extensibility to meet the special needs 

(32)

4 Eclipse Modeling Projects and Plug‐In  of development. Just imaging a complete graphical editor is like a comfortable room  for your study. The model built with EMF is a basic renting apartment without any  furniture. The graphical editor implemented by GEF is the furniture you have bought.  The  various  fees  such  as  water  costs  and  energy  costs  you  have  to  pay  are  the  maintenances of the editor. But when you use GMF, congratulations! You just rent a  student dormitory, which has some furniture for your comfortable study. You do not  need to pay other costs but the rent. If you think the furniture is not your taste, you  can even buy anything as your will.    Compared to GEF and EMF, GMF not only saves a lot of developing costs, but also  provides the flexible Plug‐In mechanism.   

4.5 Plug-In Development Environment (PDE)

Eclipse  is  a  grown  and  extensible  architecture,  which  provides  an  open  source  platform for creating an extensible IDE. One of the principles of Eclipse platform is  the  seamless  integration  of  plug‐ins  with  the  workbench  and  other  plug‐ins.  The  whole Eclipse IDE is an aggregation of various plug‐ins with a runtime core. 

 

In  the  whole  Eclipse  plug‐in  development  environment,  extension  point,  which  provides  the  interface  for  plug‐ins,  is  a  very  important  and  useful  concept.  Every  plug‐in  is  developed  based  on  the  existing  extension  point.  Those  user‐developed  plug‐ins  can  also  provide  their  extension  points,  so  that  the  further  development  based on them is possible. Among all of the plug‐ins, Workbench and Workspace are  two obligated plug‐ins, which provide a lot of extension points. 

 

Thank  plug‐in  concept,  the  launch  of  Eclipse  IDE  is  much  simpler.  The  core  of  the  platform starts first, and then the system plug‐ins will be found and loaded. Most of  the Eclipse’s functions are implemented by plug‐ins. For example, the Workbench UI  plug‐in  realizes  the  viewer  of  Eclipse  IDE,  which  provides  extension  points  for  creating  plug‐ins  to  change  file  menu  or  add  tooling  buttons.  Even  the  Java  Development Tooling (JDT) is one of the Eclipse’s plug‐ins. 

 

Theoretically  speaking,  Eclipse  IDE  is  a  big  puzzle.  Everyone  can  add  or  remove  plug‐ins  to  build  the  most  suitable  Eclipse  IDE.  The  detailed  introduction  of  Eclipse  Plug‐in Development Environment is beyond this paper. In Chapter 5 we will give out  some closing introductions through the development of car file export plug‐in.   

(33)

5 Implementation of Graphical Editor

5.1 Installation of GMF

Eclipse  community  provides  three  ways  to  get  GMF  plug‐in.  The  first  way  is  using  Eclipse Software Update Manager to download and install the plug‐in automatically.  After  the  installation,  the  Eclipse  has  to  restart  to  take  the  plug‐in  into  effect.  The  second  way  is  going  to  the  GMF  download  site  to  download  the  plug‐in  package,  manually  copy  the  plug‐in  folder  into  Eclipse plugins  folder.  Starting  the  Eclipse, 

you will find the GMF plug‐in has been installed and is ready to use. The third way is  the  simplest  way.  You  can  directly go  to  the  Eclipse  download  site  and  choose  the  Eclipse  Modeling  Tools,  which  collects  almost  all  of  the  Modeling  Project  components  like  EMF,  GMF  etc.  In  this  paper  I  have  downloaded  Eclipse  Modeling  Tools directly. 

 

After downloading and starting Eclipse, the Workspace should be set. Then we can  use  Eclipse  New  Wizard  to  create  a  new  GMF  Project,  which  is  displayed  in  Figure  5.1. 

 

 

(34)

5 Implementation of Graphical Editor    After creating the new GMF Project, the project folder structure in Eclipse Package  Explorer should be seen as the Figure 5.2.     

Figure 5.2 Project Folder Structure

The first step for GMF project development is to create Ecore Model via Eclipse New Wizard,  which is the meta‐model for the later generated models. The Java codes generated based on  Ecore  model  are  the  implementation  of  EMF,  which  provides  the  fundament  for  GMF  development.  After  generating  EMF  Java  codes,  the  development  of  EMF  is  accomplished.  GMF implementation starts with establishing Graphical Definition Model, Tooling Definition  Model  and  Mapping  Model  through  Eclipse  New  Wizard.  These  models  support  the  Generator  Model,  which  generates  the  diagram  codes.  In  the  following  Sections,  we  will  introduce the whole Cafe application editor implementation process in details. 

 

5.2 Ecore Model

5.2.1 Introduction

Ecore  is  a  kind  of  meta‐model  used  to  describe  EMF  model.  Ecore  model  is  also  a  kind of EMF model, so at the same time, Ecore model is also a meta‐meta‐model. In  Ecore  model  there  are  following  components: EPackage, EClass, EAttribute,  EReference, EEnum and EDataType etc. 

 

EPackage  is  the  root  of  Ecore  model,  which  defines  the  namespace. EClass 

represents  a  class,  which  contains  an  arbitrary  amount  of  EAttributes  and  EOperations. ERefference  describes  the  connection  and  relationship  between 

(35)

two  EClasses.  EEnum  is  an  enumeration  type,  in  which  exists  at  least  one  EEnumLiteral. EDataType indicates the type of EAttribute like string, int,  float etc. 

 

EMF  provides  a  graphical  editor  for  the  constitution  of  Ecore  model,  which  can  be  implemented  as  simple  as  drawing  UML  diagram  by  drag  and  drop.  The  XML  file  describing the Ecore model changes automatically according to the modification of  Ecore  diagram.  The  Ecore  model  constitution  process  will  be  introduced  upon  the  requirements of Cafe application in next Section. 

 

5.2.2 Ecore Model Constitution

First  let’s  look  at  the  constituted  Ecore  model  diagram  and  the  diagram  editor  in  Figure 5.3. 

 

 

Figure 5.3 Ecore Model Diagram and Diagram Editor

 

In  the  left  zone  of  the  picture  is  a  tooling  palette.  Developer  can  choose  the  appropriate objects or connections, and then put it in the canvas through drag and  drop. The bottom zone shows the property of canvas and canvas components. The  value  of  property  can  be  input.  For  example  the  Name,  Ns  Prefix  and  Ns  URI  of 

Epackage  are  set  as  cafeApplication.  The  Ecore  diagram  is  constituted 

References

Related documents

To View this report, in the Tenants screen, go to the Reports button and select the Tenant List

Among the programs identified to be suitable for single mothers entrepreneurs include training and developing risk taking ability, entrepreneurial passion and tolerance for

According to the instructions of performance management theories, this article raises revised suggestions which aim to improve the level of retail banking

Table 9 presents the estimates of the labor market returns to speaking a foreign language using college and high school graduation requirements as instruments for the ability to speak

Als de realiseerbare waarde lager is dan de totale boekwaarde van het actief of activa die deel uitmaken van deze kasstroomgenererende een- heid, ontstaat een impairment loss dat

“The Future of Human Resources,” Master’s Program, National Pest Management Association, Las Vegas, Nevada, October 18, 2000.. “The Difficult Employee; Disciplining and Coaching