Showing posts with label dependency. Show all posts
Showing posts with label dependency. Show all posts

Thursday, 3 November 2022

Maven: Where did it come from?

Just a small note.

So, I started using StringUtils in my code. It's from the apache.commons.lang3 package.

Then I noticed that I am not actually using this dependency in my pom.

So I'm using a transitive dependency, which is basically a bad habit, as this transitive dependency can suddenly change.

So I need to find which transitive dependency it is, and add it to my local pom, just to be sure.

The Maven dependency in question is:

org.apache.commons:commons-lang3:3.4

A little research and it turns out mvn dependency:tree is very nice.

You get something like:

So, as it turns out commons-lang3 is a transitive dependency of info.blii.wiki:bliki-core:jar:3.1.0

Well, that's a relief, that is.

References

StackOverflow - In Maven 2, how do I know from which dependency comes a transitive dependency?
https://stackoverflow.com/questions/34144/in-maven-2-how-do-i-know-from-which-dependency-comes-a-transitive-dependency

Sunday, 24 November 2013

What's the difference between Aggregation and Composition?

I've based this article heavily on information found in Wikipedia[1]. For more information, have a look there.
association
a family of links to different classes. For example: person-address
aggregation
a specific kind of association between only two classes, parts can belong together but are things of themselves. For example: duck-pond, person-room
composition
a specific kind of association between only two classes, but stronger than an aggregation, parent-child relationship, child cannot exist without the parent. For example: car-steeringwheel/house-room
dependency
a weak relationship, which indicates that one class depends on another because it uses it at some point in time. One class depends on another if the independent class is a parameter variable or local variable of a method of the dependent class. This is different from an association, where an attribute of the dependent class is an instance of the independent class. For example: AuthenticationService-User

Note

In the Real World™ a car engine is part of a car, and if the car is scrapped (destroyed), so is the engine. In the realm of Software or Databases, it is often the case that an engine is suitable for more than one model car. So, matters are never black and white.[1]

References

[1] Wikipedia - Class diagram
http://en.wikipedia.org/wiki/Class_diagram