OMGi Application Store

A service oriented application developed
       in a model driven approach
Introduction
●   The project was created during a service-
    oriented development course at BUTE-FTSRG.
●   Related open source project: OMGi Tools, an
    envirionment for model base development of
    service oriented applications
●   Participiants:
    ● Bogsch Balázs (balaggee gmail.com)

    ● Papp István (pappist87 gmail.com)

    ● Tóth Tamás (tothtamas.bme gmail.com)

    ● Tóth Zsolt (toth.zsolt.bme gmail.com)
Project scope
●   Developing a service-oriented application store
●   Features:
    ○   Services for managing accounts, apps,
        purchases, etc.
    ○   Business process based quality management
    ○   Business process based application purchase
    ○   Rule based application filter
Phases of development
●    The project was created in a model
     driven manner.
●    Main development phases:
    1. Analysis and design
         ●   Requirement analysis
         ●   Architectural design
         ●   Business process modeling
    2. Generative implementation of
       business logic
    3. Enhancement with rule based
       functionality
Model based developement process

Requirement analysis &
                           Use case          Architectural
  business process
                            model               design
       modeling




       Business            Generative        Domain specific
    process model        implementation    language & model




                         Enhancement
                         with rule based
                          functionality
Requirement analysis
●   UML based analysis
    ● Modeling functional requirements with use

      cases
    ● Modeling scenarios with activities

●   Main functionality
    ● Account management for customers and

      developers
    ● Management of applications and versions

      for developers
    ● Transactions

    ● Automatic and manual quality

      management of uploaded apps
Example: Customer use cases
Architectural design
●   Creation of an EMF-based domain specific
    language that describes:
    ●   Business data
    ●   Business components and services
    ●   Interconnections and dependency between
        them
    ●   and other aspects
●   System architecture specification in the
    created language
Domain specific language
                     general
                     data type



                                       attribute of
                                       an entity

     service
     parameter
                                                                entity
                 business
                 service
                            technological
REST                        details
service
                                                business
                                                component




                                            reference between
                                            entities
System architecture
   Implementation of the services, which provide
   the specified functionalities

                        Quality manager
   Customer services                        Developer services
                           services

                       REST Service layer

                         Business layer


                         Database layer




                           Database
Domain specific architecture model

               Business
               component




REST
                                REST      Business
interface
                                service   service
Business process modeling
●   Modeling in BPMN
●   Specified processes:
    ●   Quality management
    ●   Application purchase (example)
Implementation: code generation
●   Technology: Xtend
●   Input: the specified system model
●   Generates the following from the system
    model:
    ●   Annotated JPA entity classes
    ●   Annotated REST interfaces of business services
    ●   Stubs for business logic with dependencies
●   The generated code is runnable on OSGi
    platform
●   For more: check OMGi Tools
Code generation example:
  Annotated JPA entities
@Entity
//...
public class Customer extends User {

//...

   @ManyToMany
   private List<App> purchasedApps = new ArrayList<App>();

   public List<App> getPurchasedApps() {
       return purchasedApps;
   }

   public void setPurchasedApps(List<App> purchasedApps) {
       this.purchasedApps = purchasedApps;
   }
//...
Code generation example:
  Annotated REST services
@Path("/rscustomermanager")
public class RsCustomerManager i mplements IRsCustomerManager {

   private CustomerManager customerManager = new CustomerManager();

//...

    @DELETE
    @Path("removecustomer/{customerId}")
    @Produces("text/plain")
    @Override
    public Response removeCustomer(@PathParam("customerId") String
  customerId)
             throws NumberFormatException, DatabaseAccessException,
             NoSuchEntitytException {
        System.out.println("INFO: RemoveCustomer service called....");
        return Response.status(200).entity("Service called succesfully");
    }
//...
Code generation example:
  Business logic stubs
public class CustomerManager implements ICustomerManager {

   private IUserAccountManager userAccountManager =      new
 UserAccountManager();

//...

    @Override
    public void removeCustomer( int customerId) throws
  DatabaseAccessException,
             NoSuchEntitytException {
        //ToDo
        return;
        }
//...
Implementation: business processes
●   Implementation of services, which are called from
    business processes
    ●   Call REST services from WorkItem handlers




                   Application purchase REST services

                          REST Service layer


                             Business layer
Enhancement with rule based
    functionality
●   Add „Genius” feature to the system
    ●   Intelligent, rule based application
        recommendation
    ●   Considering user habits and business
        interests
        ●   Preferred expensive and frequently purchased
            applications
        ●   Preferred the works of developers from whom the
            user purchased a lot
        ●   Preferred applications purchesed by user who has
            similar purchasing habits
        ●   Preferred applications from category which is
            popular for user
Enhancement with rule based
        functionality – implementation - 1
●   Enlargement the system model and generate
    new components and services
●   Implement „Genius” REST service
    ●   Request parameter customer ID and the response a list
        of recommend applications
●   Implement necessary business services in
    business logic layer
●   Use JBoss Drools rule engine
    ●   Weighting applications when a rule is activated
Enhancement with rule based
functionality – implementation - 2
Request
            Collect
                                    Collect possible applications
             data
                                    (e.g. not purchased)



                                                    Genius REST Service



           Fire rules                                  Business layer
Response

                        Get applicaions’ metrics:
                         ●   app popularity
                         ●   generated income
                         ●   developer popularity
                         ●   user similarity
Used technolgies
 Business processes: jBPM        Business rules: JBoss Drools



                  REST service layer: Jersey


             Business layer: OSGi, JEE, .Net WPF


              Database access layer: EclipseLink




                      Database: Derby
Links
●   BUTE Fault Tolerant Systems Research Group
    http://www.inf.mit.bme.hu/en

●   SOA course at BUTE
    http://www.inf.mit.bme.hu/edu/courses/szolgint

●   OMGi Tools
    http://code.google.com/p/omgi-tools/

OMGi application store

  • 1.
    OMGi Application Store Aservice oriented application developed in a model driven approach
  • 2.
    Introduction ● The project was created during a service- oriented development course at BUTE-FTSRG. ● Related open source project: OMGi Tools, an envirionment for model base development of service oriented applications ● Participiants: ● Bogsch Balázs (balaggee gmail.com) ● Papp István (pappist87 gmail.com) ● Tóth Tamás (tothtamas.bme gmail.com) ● Tóth Zsolt (toth.zsolt.bme gmail.com)
  • 3.
    Project scope ● Developing a service-oriented application store ● Features: ○ Services for managing accounts, apps, purchases, etc. ○ Business process based quality management ○ Business process based application purchase ○ Rule based application filter
  • 4.
    Phases of development ● The project was created in a model driven manner. ● Main development phases: 1. Analysis and design ● Requirement analysis ● Architectural design ● Business process modeling 2. Generative implementation of business logic 3. Enhancement with rule based functionality
  • 5.
    Model based developementprocess Requirement analysis & Use case Architectural business process model design modeling Business Generative Domain specific process model implementation language & model Enhancement with rule based functionality
  • 6.
    Requirement analysis ● UML based analysis ● Modeling functional requirements with use cases ● Modeling scenarios with activities ● Main functionality ● Account management for customers and developers ● Management of applications and versions for developers ● Transactions ● Automatic and manual quality management of uploaded apps
  • 7.
  • 8.
    Architectural design ● Creation of an EMF-based domain specific language that describes: ● Business data ● Business components and services ● Interconnections and dependency between them ● and other aspects ● System architecture specification in the created language
  • 9.
    Domain specific language general data type attribute of an entity service parameter entity business service technological REST details service business component reference between entities
  • 10.
    System architecture Implementation of the services, which provide the specified functionalities Quality manager Customer services Developer services services REST Service layer Business layer Database layer Database
  • 11.
    Domain specific architecturemodel Business component REST REST Business interface service service
  • 12.
    Business process modeling ● Modeling in BPMN ● Specified processes: ● Quality management ● Application purchase (example)
  • 13.
    Implementation: code generation ● Technology: Xtend ● Input: the specified system model ● Generates the following from the system model: ● Annotated JPA entity classes ● Annotated REST interfaces of business services ● Stubs for business logic with dependencies ● The generated code is runnable on OSGi platform ● For more: check OMGi Tools
  • 14.
    Code generation example: Annotated JPA entities @Entity //... public class Customer extends User { //... @ManyToMany private List<App> purchasedApps = new ArrayList<App>(); public List<App> getPurchasedApps() { return purchasedApps; } public void setPurchasedApps(List<App> purchasedApps) { this.purchasedApps = purchasedApps; } //...
  • 15.
    Code generation example: Annotated REST services @Path("/rscustomermanager") public class RsCustomerManager i mplements IRsCustomerManager { private CustomerManager customerManager = new CustomerManager(); //... @DELETE @Path("removecustomer/{customerId}") @Produces("text/plain") @Override public Response removeCustomer(@PathParam("customerId") String customerId) throws NumberFormatException, DatabaseAccessException, NoSuchEntitytException { System.out.println("INFO: RemoveCustomer service called...."); return Response.status(200).entity("Service called succesfully"); } //...
  • 16.
    Code generation example: Business logic stubs public class CustomerManager implements ICustomerManager { private IUserAccountManager userAccountManager = new UserAccountManager(); //... @Override public void removeCustomer( int customerId) throws DatabaseAccessException, NoSuchEntitytException { //ToDo return; } //...
  • 17.
    Implementation: business processes ● Implementation of services, which are called from business processes ● Call REST services from WorkItem handlers Application purchase REST services REST Service layer Business layer
  • 18.
    Enhancement with rulebased functionality ● Add „Genius” feature to the system ● Intelligent, rule based application recommendation ● Considering user habits and business interests ● Preferred expensive and frequently purchased applications ● Preferred the works of developers from whom the user purchased a lot ● Preferred applications purchesed by user who has similar purchasing habits ● Preferred applications from category which is popular for user
  • 19.
    Enhancement with rulebased functionality – implementation - 1 ● Enlargement the system model and generate new components and services ● Implement „Genius” REST service ● Request parameter customer ID and the response a list of recommend applications ● Implement necessary business services in business logic layer ● Use JBoss Drools rule engine ● Weighting applications when a rule is activated
  • 20.
    Enhancement with rulebased functionality – implementation - 2 Request Collect Collect possible applications data (e.g. not purchased) Genius REST Service Fire rules Business layer Response Get applicaions’ metrics: ● app popularity ● generated income ● developer popularity ● user similarity
  • 21.
    Used technolgies Businessprocesses: jBPM Business rules: JBoss Drools REST service layer: Jersey Business layer: OSGi, JEE, .Net WPF Database access layer: EclipseLink Database: Derby
  • 22.
    Links ● BUTE Fault Tolerant Systems Research Group http://www.inf.mit.bme.hu/en ● SOA course at BUTE http://www.inf.mit.bme.hu/edu/courses/szolgint ● OMGi Tools http://code.google.com/p/omgi-tools/