What does slash before a Class name mean - class

A Class has slash at front and is an Abstract. I have seen derived attributes in class with slash at the beginning but I don't know what does it mean when we have slash before a Class name.

The only mention of a slash in front of a classifier name in the UML2 spec concerns interfaces of components. In ch. 8.3.1, p. 155:
Interfaces that are exposed by a Component and notated on a diagram, either
directly or through a port definition, may be inherited from a supertype
component. These interfaces are indicated on the diagram by preceding the name
of the interface by a forward slash.
This seems unlikely to be the case in your example however. So my best guess would be that it's some non-normative use. Apparently some people use a slash to indicate the classifier to be an interface. But again, that's non-normative - the correct presentation would be using the «interface» keyword.

I think you kind of answered this yourself. A slash in front of an attribute means that the attribute is derived. The value of a derived class is calculated from the value of other base classes in the diagram.
This is sometimes denoted by an operation like convertToDC():DerivedClass listed in the object to send information from the base class to the derived class.
Here's a little more information that might help you out.

A slash in front of a class name is imo not allowed by the UML spec. So this seems to be an error. You should ask the author of the diagram (or tool which created it) about the slash.
(Regarding the derived attributes you are correct. But they are not defined by the superclass but a computation rule.)

Related

How are OO interfaces treated in component diagrams?

My component diagram is mostly components, ports, and interfaces. The interfaces have operations and attributes. They do not capture any class based OO at the moment. What's the right way of doing that?
My options as I see them is either:
Add the class constructors to the component interfaces, and let the type carry remaining details like class operations.
Duplicate class interfaces into the component interfaces, e.g. having the class object as first parameter.
From the two the former is least work obviously. But perhaps there is a better way I've overlooked.
Notation
The easiest way to do this is to capture the interfaces in a separate class diagram, with only «interface» classifiers. The advantage is that these classifiers give a (hopefully short) name to an interface, and describe the attributes and operations that are needed, with all required details, including constructors (keep in mind that in UML constructors should be preceded with «Create»)
You can then show for the components in your component diagram the interfaces provided (lollipop) and required (socket) just referring to the named interfaces, without cluttering the diagram with lots of redundant interface specifications.
Design
When you refer to duplicating class interfaces at the component level, I understand that you mean to add attributes (parts?) and operations to the component.
Of course, components implementing the same implicit interface could in principle be interchangeable. However, this approach does not allow to have a clear understanding of the dependencies, and in particular use dependencies, that are practical to decouple components. In other words, your components would be hard-wired.
Adding class constructors at the component level seems cleaner in this regard, since your class constructor would reuse classes that are defined somewhere else. But if you're going into that direction, you could go one step further and consider using a factory class:
The factory class constructs objects of a given class or a given interface
Your component would be initialized or configured with such factory provided from outside. The factories could be interchanged to construct different kind of objects that meet the requirements.
*. If you go that way, I come back to the notational topic: the lolipo/socket notation would then allow to highlight better the decoupling that this design would offer.
I didn't understand the options you describe. Maybe a diagram would help. Here is how I would do it:
The specification component has two ports and is indirectly instantiated. For the realization component I select two classes that are realizing the component. Class1 has an operation that uses the service defined by interface I1. Class2 implements the service promised by I2. Since port p2 has a multiplicity of 16, the part typed by Class2 also has at least this multiplicity. The constructors (with the «create» stereotype), don't have parameters, so that the component can be constructed without any additional logic.
If you need additional logic, you can use directly instantiated components. They have constructors that could call the parametrized constructors of realizing classes and also create the wiring.

Compliance with BEM specifications

Does this code violate the BEM specification or is it a "mix?
<button class="corp-info__button-read-more button">Read More</button>
It's the class button that interests me.
In principle it's not a problem. However:
You might want to place the button class (it seems to define the more general styles) first and corp-info__button-read-more second (seem to represent the more specific styles).
Always order bem classes from general to specific in your class attribute.
Also maybe you want (although it's advice you didn't ask for) to distinguish between corp-info__button and a respective modifier corp-info__button--read-more.
In orthodox BEM a single dash has no semantic meaning, therefore --read-more is simply a modifier name.

Uni-directional association or Interface notation (UML)?

Either the above notation indicates Uni-Directional Association (both strong [solid lines] and weak [dotted lines]), or the notation is inconsistent with traditional UML and is trying to indicate an Interface with the dotted lines (without appropriate 'arrowheads'). What do you guys think?
One simple look tells that the author has no idea of UML. Look at the dependency between Part and Product. Clearly it's the wrong way around. Further, an abstract class must be concretized somewhere, which is not the case (I guess the two lower associations should be generalizations). Ask the author what he wanted to say.

How can I describe these types in UML class diagram?

I'm making a class diagram for a project.
How can I describe vectors, lists, files or unsigned types?
I would like to make a detailed diagram so I need to specify the types of the members and the input/output parameters of the methods.
Thank you all!
For more detailed description of the inner structure of the class you need a Composite Structure Diagram. There you can describe your methods as "ports". And your fields as attributes. You can show there really almost everything!
For detailed description of the specific instances of the class and their mutual behaviour you need an Object diagram.
At the links applied you can see a bit how to make them. But take it as a start only.
The class diagram is too common to describe the inner structure of the class. It is tooled for the description of the inter-classes relations. So, you can put your information into the model of the class, but some of it won't be seen on the diagram. But I would advise you to start from the class diagram and make it as detailed as it can show and only later go to more detailed diagrams. Maybe you won't need them after all.
Edit:
You can make a port on the border of your class, name it fileName and connect it to io interface you use. (Composite Structure Diagram only)
As for vector/list, it is easier, and could be done in a Class Diagram. If you want to show that some attribute is a vector or list, simply write: someAttr:List or put a List block on the diagram, draw association to it and name its end "someAttribute". You could do it with File, too, but there you should draw more, I think, to show the used io interface.
For showing attributes in class diagram also look here.
You should use an uml class diagramm. [Link][1]
In a class diagramm you can relate class members with types, functions with parameters and signatures.
[1] http://www.holub.com/goodies/uml/
(Somebody can format this? IMHO SO app can not handle links..)
Your question is not clear to me. There are two variants:
you need to define what type of collections (vector, list etc) in specific programming language should be used to implement multicity element ([N], [0..N] ordered or unordered, unique or nonuniqu)
It is not possible to explicitly define in UML. You can only declare, what type it is. For example in note or constraint
You need simply define types of collection
Use ordinary class or DataType element to define
Standard syntax for member (attribute, port etc.) is following: +name:Type[Multiplicity]{contraints}
The same syntax is used for parameters (all types) of operation (methods in programming language)

What does it mean in UML that instance could realize more than 1 classifier?

Does any programming language provide such a thing?
Where could this be used?
For example:
note that somethingStrange is not a class, its an instance (its underlined) and this is an object diagram
Spec (section 7.3.22) says:
An instance specification is depicted using the same notation as its classifier, but in place of the classifier name appears an underlined concatenation of the instance name (if any), a colon (‘:’) and the classifier name or names.
The convention for showing multiple classifiers is to separate their names by commas.
So im stuck with "multiple classifiers".
Any language with extensional rather than intensional typing will allow such constructs.
For example, in RDF two sources could make claims about a web resource which are completely conflicting, or in a 'duck type' language an object could have all the characteristics of two otherwise unrelated types.
Extensional languages classify objects by their properties - if it has prongs it's a fork, if it's got a handle and a bowl it's a spoon, if it has both prongs and a bowl it is both a fork and a spoon.
The difference between such languages and class oriented intensional languages such as C++/Java/C# to which UML is more commonly applied, is that you don't need a spork class to define things which are both spoons and forks - whether things belong to a classifier is defined by whether they meet the requirements of the classifier.
That's multiple inheritance if you're referring to classes (except that you should use solid edges for generalization), nothing wrong with that ;)
Note that an interface is also a classifier, so also the text of your question needs a bit of refinement -- nothing wrong with generalizing more than one interface, after all.
It's is a Dependency.
Dependency is a weaker form of relationship which indicates that one class depends on another because it uses it at some point of time. One class depends on another if the latter is a parameter variable or local variable of a method of the former. This is different from an association, where an attribute of the former is an instance of the latter.
In other words your somethingStance class will use both Cat and Panzer
The below it is just an example of how it might look like
Public class SomethingStrange{
public Cat CatDependency{get;set;}
public Panzer PanzerDependency{get;set;}
}
UML does allow an object to be instance of several different classes (even if they are unrelated) at the same time. The fact that this is not the normal convention and not supported by programming languages is a different issue. UML tries to be as broad as possible even if specific technologies only can implement a subset of it.