Chapter 4 Flashcards

1
Q

Name the three implementation layers of component framework?

A
  1. Platform
  2. Container
  3. Components
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

From a conceptual point of view, software component C consists of three items

A
  • A component identifier id
  • Component specification spc, and
  • Component body bdy

C = <id, spc, bdy>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Explain composition mechanism

A

Composition mechanisms explain how components are composed and deployed in a framework.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Explain the main composition mechanisms of component frameworks

A
  1. Bundling: it means constructing new component C from the given components C1, …Cn before deployment. C is a component with its name, specification and body.
    Bundling is sometimes called Aggregation.
  2. Deploying: it means making the name and body of components C available within a container D.
  3. Connecting: it means making the services of a component available to another component at runtime. This is done by passing references from one component to another.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Explain OSGi

A

It is a component framework of Java that supports dynamic installation and management of components. Complete applications and single components can be remotely installed, started, stopped, updated and uninstalled without requiring a reboot of the host process.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

OSGi framework basics to know

A
  • OSGi defines the structure and syntax of deployable components which are called bundle in OSGi context
  • OSGi provides a container together with a sophisticated API for installing, uninstalling, and dynamically managing components.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Services in OSGi

A

They are identified by Java interfaces.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What does Activator class mean in OSGi component?

A

It contains the code for initial startup and final cleanup just like Glue code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the important aspect of OSGi container?

A

It stores its current state in a persistent representation when the container is closed. If the container is relaunched, it sets up the state it was in before closing.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Components in general and OSGi bundles have two functions:

A

They provide services and manage code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

With the dynamic runtime environment of OSGi framework, at runtime, the when the framework/container is running :

A
  1. Bundles can be installed and resolved and uninstalled
  2. Resolved bundles can be started, and stopped
  3. Services can be registered and unregistered
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Limitation of service listeners

A

It is more suitable for a small systems, for a complex system and much services, a more suitable alternative Service trackers or Declarative Services that OSGi provides.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Difference between declarative services and service listeners.

A

Instead of describing in the program how service listeners reacts to changes, declarative services describes the dependencies and properties of services in an additional XML file.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Explain the two kinds of components the OSGi framework supports

A
  1. Immediate components: it is activated as soon as its dependencies are satisfied
  2. Delayed components: it is activated as soon as it’s service is requested.

All components providing services are delayed components while others are immediate components.
You can override this by setting the parameter immediate of the @Component annotation to false.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

OSGi service listeners are based on

A

Events i.e publish-subscribe principle.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What do you understand by Topics in publish-subscribe events?

A

Topics is the common signal names that senders and receivers have to agree on, its a precondition for the communication between senders and receivers.

17
Q

Events main components?

A
  • Event publisher: it sends out events for a particular topic.
  • Event subscriber: it receives all the messages for a particular topic.
18
Q

Limitations of OSGi framework

A

it provides no support or guidelines for handling concurrency and synchronisation issues.
It is a weakness to component developers who do not know the execution context in which their components will be used.

19
Q

Hierarchical composition provides

A

better control of the interface of the new component and better encapsulation of the components used.

20
Q

Let C1 = <id1, spc1,bdy1> and C2 = <id2,spc2,bdy2> be two components. When are C1 and C2 considered to be equal?
is it sufficient that the specification is the same?

A

Two components are equal if they have the same name, specification and body.

It is not sufficient that they have or satisfy the same specifications.

21
Q

A bundle can be in different states in the OSGi container. What corresponds to the transition from INSTALLED to RESOLVED in traditional software construction?

A

The transition from INSTALLED to RESOLVED corresponds to linking in software construction with compiler, linker and loader.

22
Q

In OSGi program code is managed in the form of ?

A

Java packages

23
Q

What are the static and dynamic aspects of bundles? How are they related?

A

Bundles can provide packages (static aspect) and services (dynamic aspect)

The dynamic aspect reflects the provided interfaces and services of components, what the clients want to have. The static aspect is necessary to share and effectively structure the code that components need to provide the services.

24
Q

The goal of component frameworks is?

A

black-box reuse

25
Q

How many layers do we have in software systems and in CBSD with component frameworks?

A

We have two layers in software systems
1. The platform
2. System of interest

We have three layers in Component frameworks
1. The platform
2. The container
3. The components

26
Q

Why does a bundle have to list the OSGi framework package as imports?

A

It is because the activator class needs access to the container API.

27
Q

What is the function of the activator class in OSGi?

A

it is the glue code that sets up the component and its service.

28
Q

OSGi bundles and components have two functions

A

They provide services and manage code.

29
Q

Limitation of OSGi framework

A

it provides no support or guidelines for handling concurrency and synchronisation issues.