We argue through our work that, unlike what is often claimed
(e.g., [Koe99]), message-oriented middleware and object-oriented principles
are not contradictory. In [EGS00a], we have made a first step, by
introducing a programming abstraction called DISTRIBUTED
ASYNCHRONOUS COLLECTION (DAC) which is versatile
enough to express commonalities between the different message-oriented
interactions styles. In that paper we have focused on topic-based
publish/subscribe.
In this paper, we have attacked another bastion, content-based
publish/subscribe, which is presumed to contradict object-oriented principles by
its very nature. We have illustrated that it
is indeed possible to express content-based subscription patterns in a way that
fully preserves encapsulation. Moreover, we have shown that
our approach offers further practical
benefits over contemporary approaches, like the possibility to prevent
syntax errors and type errors.
In terms of performance, the cost of our solution is
incurred by the latency resulting from the use of
JAVA reflection. In our case, this use is however
reduced to verifications of subscription patterns aiming at avoiding
type errors. After this initialization phase, dynamic invocations are circumvented by using
static code generated at runtime without any modification to the JAVA compiler
or VM. The throughput of our system is thus not
conditioned by the use of reflection, as proven by the resulting
performances.
We are furthermore currently working on a new optimization scheme combining the
benefits of our static and dynamic optimizations. The idea is to generate static
code from dynamic invocation trees, to further improve performance but
also to reduce the overall compilation effort.
The cost of our solution in terms of feasibility is limited to the
need for structural reflection; yet with
such minimal features that the inherent JAVA
reflection capabilities can satisfy this need.
We do not claim that our content-based subscription scheme is the ultimate solution to content-based publish/subscribe, nor that it replaces existing specifications. It should rather be seen as a pragmatic attempt to circumventing shortcomings of other approaches. Our filter library is not limited to the context of DACs, but could be put to work easily in other existing event-based systems.