The Observation API (hey, it's not the Observable pattern)
As I said in
I'm going to post on my blog a series about the use of Semantic
Technologies and how they are being used in some of my projects.
Today let's start giving a small domain model and then design a related
abstract API. In the next post I'll show you how to
implement it on the top of a
RDF triple store.
API is designed to manage a set of "observations" (of whatever, by
anybody, etc... let's keep it generic in order to respect the "AAA
slogan": Anyone can say Anything about Any topic), so I'm
it "the Observation
Let's introduce the key abstractions:
- An Observer
represents entities capable to make observations. It may be a
physical person, or a device, or anything else makes sense.
- An Observation
is made at a certain time and Location,
by one or more Observers
and is composed of one or more ObservationItems.
- An ObservationItem
pairs an Observable
with a Cardinality.
- An Observable
has no special properties and can be anything.
- A Cardinality
may be a single integer number, a close or open range of integers (e.g.
"between 10 and 20", or "more than 5"), or "undefined".
- An ObservationSet
is a set of Observations.
- A Source
is where a certain datum comes from (i.e. who or what provided it,
inserting into the database).
All of the above concepts are going to become classes, so I'm now
referring to them with the code typo convention. style="font-family: monospace;">Observer,
have a single property exposed through style="font-family: monospace;">getDisplayName(),
that is the identifier used for rendering the object in a UI. Applying
some common patterns, we add a few more classes for the solution model:
style="font-weight: bold; font-family: monospace;">ObservationManager
style="font-family: monospace;"> provides way
to retrieve and create ObservationSets.
style="font-weight: bold; font-family: monospace;">Finder
is used to perform various queries.
style="font-weight: bold; font-family: monospace;">Observation.Builder
provides ways to create new Observations.
only architectural dependency introduced in the API is related to the
use of components