Common Navigator Framework Tip #1 – Know When To Use It
Join the DZone community and get the full member experience.Join For Free
of all the posts i’ve written on this blog, those on the common navigator framework have been among the most popular. this is a little surprising to me, as i don’t hear cnf mentioned very frequently. my guess is that this framework is quietly becoming an essential part of eclipse rcp.
because of this, i’ve decided to write a set of posts discussing some of the cnf tips that i’ve found valuable over the years. and i think the best place to start is knowing when to use it . the common navigator framework is complicated because it is trying to solve a complicated problem. it will only make your life easier if you’re using it for the purpose it’s designed for. so what is that purpose?
modularity and extensibility
well first, cnf was not created to make the development of navigators easier. if you have fairly normal navigator requirements in your application, cnf is probably not for you and you’ll save yourself a lot of headaches by omitting it.
instead, cnf is designed to create navigators that support
. with cnf, various osgi bundles in your rcp application can contribute navigator content at runtime.
cnf allows your bundles to declaratively contribute content to a navigator, and this is not a simple exercise. as users of cnf, we need to wire together navigators and their content in sophisticated parent/child relationships, and then overlay on top of this structure a set of actions, filters, drag/drop handlers, etc.
does it have to be so hard?
some of you might be thinking modularity is supposed to help us to simplify our applications. why does this stuff have to be so darned hard? well this is true to a point. modularity allows us to take information hiding to an entirely new level and to the extent that we can hide complexity, our applications become simpler.
but when dealing with modular uis in particular, the difficultly arises when we work with the joints or pivot-points between modules. in these specific cases, there is always complexity because we have to define in detail how our modules relate to each other.
so the next time you’re struggling with a complex cnf extension point, ask yourself whether you really need this functionality. if you do, then embrace cnf for what it is: a complex solution to a complex problem.
Opinions expressed by DZone contributors are their own.