Let's take simple real life use case from ESTCube project – operator has to have overview of the weather conditions to operate ground station safely. Strong wind and extreme temperatures can cause damages to radio antenna.We have several sources available for up to date weather data. All of them are providing info over HTTP in some sort of format XML, JSON etc. Logical step would be to add WeatherStation component to the hbird based system. This component polls all the available sources in predefined interval, parses HTTP responses and sends data as Parameters to the system. All the sources have their own format for data. Eg. temperature can be presented as "Temperature", "temperature", "temp" etc. There is no point to forward N+1 different Parameters holding temperature to the system. Instead WeatherStation will use single unified Parameter for temperature – let's name it "WeatherStation.tm.Temperature" for example. Each weather ParameterGroup will have extra Parameter "WeatherStation.tm.Source" to identify the actual source of data.
Now it gets unclear to me. How does WeatherStation know the exact names of needed Parameters ("WeatherStation.tm.Temperature" and "WeatherStation.tm.Source" in this case)? They can be defined in SSM but WeatherStation has no idea how to pick the correct ones. So there has to be some kind of constants available in sense of Java source code. Most likely constants have to be available to other components also. For example in the UI there maybe need for dedicated view for temperature etc. Now there is problem – SSM and constants have to be synchronized. Otherwise there will be all sorts of troubles in case only one of them is modified and other is unchanged.
How will LimitChecker function? As I understand there will be Parameters, Limits and some kind of OutOfLimit events/objects. When new Parameter with value is received from the system LimitChecker will validate it against all related Limits and fire OutOfLimit event for each violation. First question in my mind is – where are the limits stored? LimitCheker can go offline in any moment and come back later on. So the limits have to be stored persistently somewhere. Second question is how does LimitChecker know which Limit is related to which Parameter? First solution what comes in to my mind is to include Parameter name in the Limit. At the moment there are no Limit and OutOfLimit objects in code base.
I'll try to respond point-by-point, please find my answers below.
Am 2012-04-02 16:31, schrieb Lauri Kimmel:
> At the moment there are no business components available in github
> and
> it is bit too hard to get bigger picture how to setup hbird based
> system.
I think the best way would be for Gert to publish the application-layer
parts he's written under his GitHub account, maybe under a name like
"hbird-application", or something like it. Users like ESTcube could then
pull in dependencies from the application layer by pointing to the
artifacts in there.
I think the answer to this one is that the parameter names should be
set in configuration. Once the parameter name is set, it needs to be
configured in the applications that need to use it. Compare this to the
MMI with the world wind globe: It gets all kinds of parameters, but it
needs to know which ones carry latitude, longitude, and altitude. There
is no way around setting it. If you change the parameter name somewhere,
or make a typo, your application can't do anything about it. As you
said, it can't guess which parameters it needs.
>
> How will LimitChecker function? As I understand there will be
> Parameters, Limits and some kind of OutOfLimit events/objects. When
> new Parameter with value is received from the system LimitChecker
> will
> validate it against all related Limits and fire OutOfLimit event for
> each violation. First question in my mind is – where are the limits
> stored? LimitCheker can go offline in any moment and come back later
> on. So the limits have to be stored persistently somewhere. Second
> question is how does LimitChecker know which Limit is related to
> which
> Parameter? First solution what comes in to my mind is to include
> Parameter name in the Limit. At the moment there are no Limit and
> OutOfLimit objects in code base.
>
> If we are talking about triggering events based on limit checking
> there comes another set of domain object into my mind – Rules and
> Actions. They also need to be persistently stored some place. Do you
> have any thoughts about this?
Well, my thoughts about a limit checker are this:
Make a data structure that has a parameter name, upper limit, and lower
limit. This will be fairly compact, and will easily fit into memory even
for thousands of parameters. Also, such a structure is trivial to
persist to disk or update on-line in case it's changed - just overwrite
the parameter's entry if the limits shall change. Such an application
should only take an afternoon to write, but we haven't got one yet. I
remember Gert laughed at this design (because it's "monolithic") when I
presented it a year ago or so, but I still believe it's viable and easy
to implement.
> As I see hbird based system needs some (pre)defined domain specific
> model. Is it SSM or something else I don't know yet. Updates in
> runtime are good things to have. In the other hand it's not good to
> have hardcoded magic value in several places in the system like
> mentioned "WeatherStation.tm.Temperature" in WeatherStation and UI
> component.
Let's assume we had such a model - you'd still have to tell your
parameter injector, limit checker, displays and so forth exactly which
parameter in that model they should deal with. At some point you'll have
to "get real" and configure your system. As long as that happens in
config files, I'm happy with it. Magic values in the code of course are
a different matter and should not exist.
> Whatever is the solution for the Model, it has to be made available
> in
> the system. There is component called space-system-publisher. Current
> implementation is simple Java class. What is the future plan for it
> – standalone component in the system working over JMS/etc or
> something else?
It is just a simple Java class, that's true, but with Camel you can
wire its output to, for example, ActiveMQ, and have all your
applications listen to the publisher for updates. So in that sense, it
is already a standalone-application, just that most of the code is part
of Camel.
> Additionally few thought about Parameters. There is lot of static
> information in Parameter – name, qualified name, long and short
> description. Only thing which is changing is value and it's changing
> in time. Maybe it makes sense to have two classes something like this
>
> class ParameterDefinition<T> {
> String name;
> String qualifiedName;
> String shortDescription;
> String longDescription;
> T defaultValue;
> }
>
> class ParameterValueInTime<T> {
> ParameterDefinition<T> definition;
> T value;
> Long timestamp;
> }
>
> What do you think?
The idea here was that all properties should be contained within a
single parameter sample, so that you don't need to look up a parameter's
name when you receive one of its samples - the name and all metadata
comes with the parameter sample. This is due to experience with a
mission control system that requires lots of lookups like that. The
other reason is that, again, you could change parameters' metadata and
keep the system running, requiring zero downstream applications to
restart. This is a design decision made to make it possible to use
Hummingbird in an EGSE context, where definitions might change rapidly.
Looking back at your parameter archive, you'd see the evolution of
metadata, as it's all preserved per sample. Of course this is a massive
overhead, but we decided to go that route in the early days of
Hummingbird.
I agree that your proposed approach is more normalised and more
efficient in terms of data transmission and storage, but it is less
flexible and doesn't allow modifications like described above. Of course
we haven't ever tested this under high load, so we have no idea how much
of a price we pay for this flexibility. It might well turn out that
lookups aren't as bad after all, and we shouldn't transmit the same
descriptions over and over, just because someone might want to look at
an earlier version of the "shortDescription". I'm open for debate, but
we should do some benchmarking first. These decisions were made by gut
feeling, and are not backed by hard facts.
Cheers,
Johannes
I think the best way would be for Gert to publish the application-layer parts he's written under his GitHub account, maybe under a name like "hbird-application", or something like it. Users like ESTcube could then pull in dependencies from the application layer by pointing to the artifacts in there.
At the moment there are no business components available in github and
it is bit too hard to get bigger picture how to setup hbird based
system.
Well, my thoughts about a limit checker are this:
How will LimitChecker function? As I understand there will be
Parameters, Limits and some kind of OutOfLimit events/objects. When
new Parameter with value is received from the system LimitChecker will
validate it against all related Limits and fire OutOfLimit event for
each violation. First question in my mind is – where are the limits
stored? LimitCheker can go offline in any moment and come back later
on. So the limits have to be stored persistently somewhere. Second
question is how does LimitChecker know which Limit is related to which
Parameter? First solution what comes in to my mind is to include
Parameter name in the Limit. At the moment there are no Limit and
OutOfLimit objects in code base.
If we are talking about triggering events based on limit checking
there comes another set of domain object into my mind – Rules and
Actions. They also need to be persistently stored some place. Do you
have any thoughts about this?
Make a data structure that has a parameter name, upper limit, and lower limit. This will be fairly compact, and will easily fit into memory even for thousands of parameters. Also, such a structure is trivial to persist to disk or update on-line in case it's changed - just overwrite the parameter's entry if the limits shall change. Such an application should only take an afternoon to write, but we haven't got one yet. I remember Gert laughed at this design (because it's "monolithic") when I presented it a year ago or so, but I still believe it's viable and easy to implement.
Let's assume we had such a model - you'd still have to tell your parameter injector, limit checker, displays and so forth exactly which parameter in that model they should deal with. At some point you'll have to "get real" and configure your system. As long as that happens in config files, I'm happy with it. Magic values in the code of course are a different matter and should not exist.
As I see hbird based system needs some (pre)defined domain specific
model. Is it SSM or something else I don't know yet. Updates in
runtime are good things to have. In the other hand it's not good to
have hardcoded magic value in several places in the system like
mentioned "WeatherStation.tm.Temperature" in WeatherStation and UI
component.
It is just a simple Java class, that's true, but with Camel you can wire its output to, for example, ActiveMQ, and have all your applications listen to the publisher for updates. So in that sense, it is already a standalone-application, just that most of the code is part of Camel.
Whatever is the solution for the Model, it has to be made available in
the system. There is component called space-system-publisher. Current
implementation is simple Java class. What is the future plan for it
– standalone component in the system working over JMS/etc or
something else?
The idea here was that all properties should be contained within a single parameter sample, so that you don't need to look up a parameter's name when you receive one of its samples - the name and all metadata comes with the parameter sample. This is due to experience with a mission control system that requires lots of lookups like that. The other reason is that, again, you could change parameters' metadata and keep the system running, requiring zero downstream applications to restart. This is a design decision made to make it possible to use Hummingbird in an EGSE context, where definitions might change rapidly. Looking back at your parameter archive, you'd see the evolution of metadata, as it's all preserved per sample. Of course this is a massive overhead, but we decided to go that route in the early days of Hummingbird.
Additionally few thought about Parameters. There is lot of static
information in Parameter – name, qualified name, long and short
description. Only thing which is changing is value and it's changing
in time. Maybe it makes sense to have two classes something like this
class ParameterDefinition<T> {
String name;
String qualifiedName;
String shortDescription;
String longDescription;
T defaultValue;
}
class ParameterValueInTime<T> {
ParameterDefinition<T> definition;
T value;
Long timestamp;
}
What do you think?
I agree that your proposed approach is more normalised and more efficient in terms of data transmission and storage, but it is less flexible and doesn't allow modifications like described above. Of course we haven't ever tested this under high load, so we have no idea how much of a price we pay for this flexibility. It might well turn out that lookups aren't as bad after all, and we shouldn't transmit the same descriptions over and over, just because someone might want to look at an earlier version of the "shortDescription". I'm open for debate, but we should do some benchmarking first. These decisions were made by gut feeling, and are not backed by hard facts.
Cheers,
Johannes
All,As suggested I have created the repository 'https://github.com/Villemos/hbird-business' which contains the new business tire and the exchange tier that the new business tier is using. Lauri is 'beta-testing' the installation right now, using the new guides on 'http://www.hbird.de/?q=getstarted'.I think we need to stop creating new repositories and instead start merging them.As part of that we finally need to get the exchange tier harmonized, agreeging on the changes Johanness has been proposing and the restructuring into services I have done.ASAP is a good time for me...Cheers,Gert.
