23.05.2014 Views

Athena Developer Guide

Athena Developer Guide

Athena Developer Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Athena</strong><br />

Chapter 13 Framework services Version/Issue: 2.0.0<br />

13.10 Developing new services<br />

13.10.1 The Service base class<br />

Within <strong>Athena</strong> we use the term "Service" to refer to a class whose job is to provide a set of facilities or<br />

utilities to be used by other components. In fact we mean more than this because a concrete service<br />

must derive from the Service base class and thus has a certain amount of predefined behaviour; for<br />

example it has initialize() and finalize() methods which are invoked by the application<br />

manager at well defined times.<br />

Figure 13.1 shows the inheritance structure for an example service called SpecificService. The<br />

key idea is that a service should derive from the Service base class and additionally implement one<br />

or more pure abstract classes (interfaces) such as IConcreteSvcType1 and<br />

IConcreteSvcType2 in the figure.<br />

Figure 13.1 Implementation of a concrete service class. Though not shown in the figure, both of the<br />

IConcreteSvcType interfaces are derived from IInterface.<br />

As discussed above, it is necessary to derive from the Service base class so that the concrete service<br />

may be made accessible to other <strong>Athena</strong> components. The actual facilities provided by the service are<br />

available via the interfaces that it provides. For example the ParticleProperties service<br />

implements an interface which provides methods for retrieving, for example, the mass of a given<br />

particle. In figure 13.1 the service implements two interfaces each of two methods.<br />

page 119

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!