Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
research:software:reflex:documentation:reflex_elements_in_a_nutshell [2007/07/30 01:33] – admin | research:software:reflex:documentation:reflex_elements_in_a_nutshell [2007/08/24 20:44] (current) – rtoledo | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Reflex Elements in a Nutshell ====== | ||
+ | In this section we will briefly review the most important elements of Reflex from the user's point of view. | ||
+ | We will see what hooksets, metaobject definitions and behavioral links are. Besides we will review structural metaobjects and links. And Finally, a subsection to explain where to define these elements. | ||
+ | |||
+ | ===== Hooksets ===== | ||
+ | |||
+ | Hooksets describe the execution points of an application to which the aspect applies, ie, the //where//. In Reflex, possible execution points are operations present in the application: | ||
+ | |||
+ | Hooksets can match certain operations based on two things: the class characteristics where the operation occur and the operation characteristics. We review the Hookset API in detail [[Hooksets|here]]. | ||
+ | |||
+ | ===== Metaobject definitions ===== | ||
+ | |||
+ | Once we have defined //where// an aspect will apply through a hookset, we need to define _what_ to do at those points, which is described by metaobject definition. This descriptor tells Reflex what metaobject it should use. It is important to mention that any object can be used as a metaobject. | ||
+ | |||
+ | Reflex accepts several kinds of metaobject definitions (all subclasses of [[http:// | ||
+ | |||
+ | To clarify this, let us briefly review four subclasses provided by Reflex: | ||
+ | * SharedMO, a pre-existing (already instantiated) object will be used, for example: System.out or an object obtained from a framework. | ||
+ | * MOClass, a new metaobject will be created when necessary (ie, when the metaobject is about to be used), based on the description given to the MOClass object. | ||
+ | * SharedFactory, | ||
+ | * FactoryClass, | ||
+ | |||
+ | ===== BLinks and RTLinks ===== | ||
+ | |||
+ | A BLink (behavioral link) can be seen as an object that acts as a relation between the hookset and the metaobject. This object provides several properties that describes how the communication will be done (there are others properties related to performance, | ||
+ | |||
+ | Once you have the hookset and the metaobject definition, the creation of behavioral links is very easy: | ||
+ | <code java> | ||
+ | BLink blink = API.links().createBLink(hookset, | ||
+ | </ | ||
+ | |||
+ | From a behavioral link, you can obtain a reference to a runtime link: a runtime representation of the behavioral link, which has several methods to alter the properties of a link such as the associated metaobject and the activation value. | ||
+ | |||
+ | The API of behavioral links is described in detail [[behavioral _links_blinks|here]]. Whereas the API of runtime links, [[runtime_links_rtlinks|here]]. | ||
+ | |||
+ | ===== SLinks and SMetaobjects ===== | ||
+ | |||
+ | Structural links and structural metaobjects are used to alter the structure of a class (like behavioral links and metaobjects are used to alter the behavior defined by a class). | ||
+ | |||
+ | Structural metaobjects must implement the [[http:// | ||
+ | |||
+ | Structural links are the relation between the class and the structural metaobject. | ||
+ | |||
+ | |||
+ | ===== Link Providers ===== | ||
+ | |||
+ | In Reflex, the way to define links that will be available since the start of the application is to use a link provider. A link provider is an instance of a class that implements the [[http:// | ||
+ | <code java> | ||
+ | public interface ILinkProvider{ | ||
+ | public Collection< | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | As you can see, this interface defines only one method: '' | ||
+ | |||
+ | In the following chapter we will see several examples that uses all these elements. |