Monday, March 03, 2014
Maven 3.1 and 3.2 are incompatible with 3.0
As title says, Apache Maven 3.1.x and 3.2.x are not compatible with 3.0.x, and this may affect your artifacts.
The main difference is whether or not, the default (compile) scope dependencies in a test, or provided scope dependency will be included in the final artifact, if you know what I mean.
In Maven 3.0, all the compile scope dependencies in test or provided scope dependencies will be included, unless they're overwritten by others in any ways.
In Maven 3.1 and 3.2 however, all the compile scope dependencies in test or provided scope dependencies will NOT be included, unless they overwrite others in any ways.
Personally, I like what Maven 3.1 and 3.2 are doing. Just a heads up you may get hurt by including ugly designed test or provided dependencies.
Wednesday, February 19, 2014
Dependency is the new Inheritance
To warm up, please have a read how bad inheritance is.
disadvantages of inheritance in java
Why extends is evil
Okay, dependency is the new inheritance, just even harder to do it right.
With inheritance, you extend something means you decide to be it, just a bit special. It's more base classes' responsibilities to make sure it doesn't become something else. With dependency however, you introduce a dependency just because it has something that's useful to you, no matter how much in it you don't need at all. Check the exclusions in pom.xml to see how many dependencies, direct or indirect, you included and later you found they caused trouble. Isn't this the new Refused Bequest, except there's no better way to solve it?
With versioned dependency, you changed something but others depend on it don't know if it breaks their part. "If it ain't broke, don't fix it". They choose to stick with the old version of what you've changed, and not to move forward with you. Without their following and feedback, you make further changes more freely, knowing that only part, if any, of your users bother to follow what you're doing.
Popular languages, like C# and Java, only allow single inheritance to avoid the potential problem caused by multiple inheritance. This makes inheritance less dangerous for everyday use. But you are free to depend on no matter how many dependencies. Very likely, those dependencies depend on difference versions of same module, directly or indirectly. Then it becomes your job if this doesn't work and you have to manually exclude all but one, the one that can fit all. Put it simply, you have to manage and solve dependency conflict, which is never part of your job in single inheritance paradigm.
Hope I'm clear and to the point by now why dependency is the new inheritance. Versioned dependency is the root of Dependency Hell? Not really, but you must have the skills and experience to handle it.
disadvantages of inheritance in java
Why extends is evil
Okay, dependency is the new inheritance, just even harder to do it right.
With inheritance, you extend something means you decide to be it, just a bit special. It's more base classes' responsibilities to make sure it doesn't become something else. With dependency however, you introduce a dependency just because it has something that's useful to you, no matter how much in it you don't need at all. Check the exclusions in pom.xml to see how many dependencies, direct or indirect, you included and later you found they caused trouble. Isn't this the new Refused Bequest, except there's no better way to solve it?
With versioned dependency, you changed something but others depend on it don't know if it breaks their part. "If it ain't broke, don't fix it". They choose to stick with the old version of what you've changed, and not to move forward with you. Without their following and feedback, you make further changes more freely, knowing that only part, if any, of your users bother to follow what you're doing.
Popular languages, like C# and Java, only allow single inheritance to avoid the potential problem caused by multiple inheritance. This makes inheritance less dangerous for everyday use. But you are free to depend on no matter how many dependencies. Very likely, those dependencies depend on difference versions of same module, directly or indirectly. Then it becomes your job if this doesn't work and you have to manually exclude all but one, the one that can fit all. Put it simply, you have to manage and solve dependency conflict, which is never part of your job in single inheritance paradigm.
Hope I'm clear and to the point by now why dependency is the new inheritance. Versioned dependency is the root of Dependency Hell? Not really, but you must have the skills and experience to handle it.
Subscribe to:
Posts (Atom)