On 09/04/2013 05:27 PM, mark.reinh...@oracle.com wrote:
2013/8/30 5:20 -0700, david.ll...@redhat.com:
                      ...  In addition, many best practices have emerged
that (partially or wholly) contradict the original design intent of
these systems (OSGi also falls into this category).

Do you have links to any good descriptions of these best practices?
That'd be helpful.

Not a lot as links, as mostly they are "community knowledge" among our various teams, but here's a couple for each that I can find relatively quickly:

For Maven:

* Version ranges considered harmful [1] [2] [3] [4] (and probably more); we disallow them within our own products for stability reasons * Transitive-by-default causes problems in mid to large projects due to extensive conflicts [can't find the discussion...]; fix is to use and verify exclusions, specify "provided" scope, and use maven-enforcer-plugin [5] to ban transitive dependencies

For OSGi:

* Using the full capabilities of range dependencies can cause resolution to be NP-complete; best practice is to use ranges in a more restricted manner [6] * Require-Bundle not recommended due to lack of hiding non-public packages among other things [no link] (however, to be fair this is only due to the way Require-Bundle was designed; it's not an inherent flaw, but it is a best practice not to use it, hence it fits the criteria)

As with many so-called "best practices" there are those who disagree with some or all of them; I'm not going to argue the finer points of each one. I'm just pointing out that just copying a given mechanism and adapting it straight to a somewhat similar but also somewhat different use case is doubly dangerous - on one hand, it is hard to know what went into the design of these mechanisms; and on the other hand, there is a considerable base of knowledge that comes from third parties (or just the general public) that sheds additional light on the pros and cons of these mechanisms as well.

[1] http://maven.40175.n5.nabble.com/Version-ranges-not-working-td5723909i40.html
[2] http://stackoverflow.com/a/7169847/2033093
[3] http://stackoverflow.com/a/3882490/2033093
[4] http://grokbase.com/p/maven/users/129vwgkd1c/version-ranges-not-working
[5] http://maven.apache.org/enforcer/enforcer-rules/banTransitiveDependencies.html
[6] http://wiki.apidesign.org/wiki/RangeDependenciesAnalysed

--
- DML

Reply via email to