When one class have as method parameter pointer(or reference, or object) to other class, in UML it is reflected as association or aggregation, with diamond, or have some specific notation?
4 Answers
As explained by other guys, you should use dependency and not any form of association (aggregation and composition).
A dependency means that the target element is required for the specification or implementation of the source element.
However, there are many different types of dependencies. The type of dependency can be specified by keywords and stereotypes. In your case you should use a dependency with keyword <<use>>:

To explain <<use>> I quote a part of the book UML 2 and The Unified Process from page 196:
This dependency (usage) is generated by any of the following cases:
1- An operation of class A needs a parameter of class B
2- An operation of class A returns a value of class B
3- An operation of class A uses an object of class B somewhere in its implementation but not as an attribute.
P.S: Other keywords/stereotypes a dependency can have are call, create, derive, instantiate, permit, realize, refine and trace.
9 Comments
<<use>>. See the part I added to my answer from UML 2 and the Unified Process book.What you need is not an association (nor an aggregation or a composition that are specific associations) because an association refers to an attribute of your ClassA being of type ClassB.
Here, for a method parameter, you can use a dependency arrow between your classes (dashed arrow). It is a very general relationship that should fit your purpose.
See for example here for an explanation: http://martinfowler.com/bliki/DependencyAndAssociation.html
1 Comment
Association is a link of one class to another, hence pointer/reference describe an association.
Aggregation/Composition describe the type of the association and as such are actually a detalization of it (but there are types of association that aren't aggregation/composition).
Whether or not you want to use aggregation or association depends on the level of details that you want to show in your diagram.
Given the question description, the connection is of weaker kind since it's not a static link but rather a transient one. In this case more appropriate would be to use the Dependency relation rather than association.
Comments
"The usage dependency does not specify how the client uses the supplier other than the fact that the supplier is used by the definition or implementation of the client. For example, it could mean that some method(s) within a (client) class uses objects (e.g. parameters) of the another (supplier) class . "