This example repository currently has four examples, two EMF model project examples and two OSGi (bnd workspace) examples.
## EMF model projects
***tdt4250.ra** projects - EMF model projects within resource allocation (of university staff and courses) domain
***tdt4250.transportation** project - EMF model project within transportation domain
Together these projects exemplify various modeling features of ecore, including constraints using OCL. To try them out, import with **Import... > General > Existing Projects into Workspace**.
In addition, the tdt4250.ra.* projects are used in one of the OSGi examples.
## OSGi workspaces
*[dict-ws](dict-ws/README.md) - shows how an unmodular (monolithic, one-bundle) OSGi project is transformed into a modular, flexible one, in two steps.
*[emf-ws](emf-ws/README.md) - shows how to use EMF model projects (managed by Eclipse PDE) within an OSGi project (managed by Bnd)
To try them out, import with **Import... > Bndtools > Existing Bnd Workspace** (but only one at a time). Before importing the emf-ws workspace, you should first import the **tdt4250.ra** projects and make sure the repository project is built.
This OSGi project shows how an unmodular (monolithic, one-bundle) OSGi project is transformed into a modular, flexible one, in two steps. All three variants implements a simple web service for searching one or more dictionaries. Logically, all variants consist of a domain part, the dictionary- and search-related classes (among others, a **Dict** interface and its implementations) and the web service (a **Servlet**). Technically, the variants differ in how these parts are distributed among bundles and utilize the component mechanism.
This OSGi project shows how an unmodular (monolithic, one-bundle) OSGi project is transformed into a modular, flexible one, in two steps. All three variants implements a simple web service for searching one or more dictionaries. Logically, all variants consist of a domain part, the dictionary- and search-related classes (among others, a **Dict** interface and its implementations) and the web service (a **Servlet**). Technically, the variants differ in how these parts are distributed among bundles and utilize the component mechanism.
In addition to the dict project, there is an (unrelated) example of how to use an EMF model developed using Eclipse PDE in an OSGi bundle (project) managed by Bnd(tools). The case is a REST API serving an EMF model instance, see [below](#emf-rest-in-osgi).
## Setup
## Setup
The root project and folder was created using the BndTools' Bnd OSGi Workspace wizard, and each bundle with the Bnd OSGi Project wizard. Which bundle template to use depends on the specific bundle, there are api, component and servlet bundles in this project.
The root project and folder was created using the BndTools' Bnd OSGi Workspace wizard, and each bundle with the Bnd OSGi Project wizard. Which bundle template to use depends on the specific bundle, there are api, component and servlet bundles in this project.