Do generalization arrows in class diagram has to be strictly open or is there a margin of tolerance on style of this arrows?
Open arrows are used together with a dashed/dotted line to represent dependencies.
I can't think of a standard way to use them with a regular line.
Furthermore, as Martin Fowler clearly indicates in UML Distilled, UML is just a notation. If the people that will read your diagrams are aware that open arrow = closed arrow, then feel free to use it. There is no strictness in UML.
Each element in UML has to strictly follow the normative notation proposed in the standard. With so many symbols there is a high risk that a notation variant for a symbol coincides with the normative representation of another one
Talking about UML designs without an image is like talking about girl without ...... :-)
Here is the picture of UML2 connectors in the class diagram:
alt text http://www.forum-omondo.com/documentation_eclipseuml_2008/connectors_uml2.png
Related
Should I put the test classes in the UML diagram? I can't find any "best practice" about this!
It depends. Firstly "the UML diagram" suggests that you are creating a single diagram. This is definitely not good practice. Create as many diagrams as needed lighting certain aspects of the model. So - test cases would be one of those aspects. That means: put them in (a) separate diagram(s).
To add a suggestion, if you want to model tests, you can look to UML testing profile ( UTP link) it provides needed elements to model tests, requirements and so on.
You can use SysML also since it integrates a part of UTP.
It definitely depends on context. Who is going to use the UML model and what will they use it for? In general I would say that adding test classes is going to clutter a UML model and make it difficult to understand - so no. But if the context is that the testing is what you want to explain, then clearly the test classes are going to be pretty important.
As Thomas Kilian points out, creating a number of diagrams from one underlying model is probably the right answer - and being able to do this is one of the reasons you would use UML rather than a simple diagram.
This is a preference. You can choose to or choose not to.
I would say it's better practice to have the tests modeled into the solution. But I wouldn't claim I always follow best practices 🙊
There are many diagrams needed in modeling a solution. I would focus on three: Analysis, Design, and Implementation. All three are class diagrams. All three define your solution at different abstractions.
In the analysis, you're closest to the requirements and the beginning of your solution. In here, you would want to have broad classes. I would not put tests in here since this diagram is still trying to get the shape of the solution from the user and their requirements. An analysis diagram would only have class names in a box, with lines which show their associations.
The design diagram would go into a little more detail on how classes would be built. The blueprint of the application would take shape in the design. This design can be given to any programmer and they write code which would build the solution. The interesting part of the design diagram is that it could also be given to a test engineer and they would write proper tests for the solution to be created.
The implementation diagram is the lowest level class diagram which is created. Most times, I would create this in retrospect. The implementation diagram should be a verbatim translation of the codebase. In the implementation diagram, I would have my test classes included for completeness.
Note, these are my views which I sometimes do not follow to the letter because of business constraints. However, in an ideal world, this is how I would prefer my modeling done.
What is the formal and complete definition of the words "meta-logic" and "object-logic" in Isabelle? I see people keep using these but could not find any definition for these.
You don't find them because they are specific to Isabelle (as far as I know). "Object-logic" and "meta-logic" are terms introduced by Larry Paulson (as far as I can tell). In general, though not specifically, they are related to the general terms "metalanguage" and "object language", for disciplines like logic and set theory. Do a search on those and you'll get the standard wiki pages, because they're a standard part of logic.
Here, I'm looking at page 16, 2.2.3 Meta and object language of Logic and Computation - Interactive Proof with Cambridge LCF, by Larry Paulson, published 1987. At that time he was still conforming to standard terms, but then he switched. I forgot where I read it, but he made the switch somewhere to "meta-logic" and "object-logic", to clarify things for his own purpose. The two terms are in his papers and in the Isabelle distribution docs.
Others can give you their expert knowledge, but the meta-logic specifically is what you get when you import the theory Pure, in particular, a minimal set of logical connectives, ==>, \<And>, &&&, and ==. Discussion of these are spread throughout the Isabelle distribution documentation.
I know nothing much about intuitionistic logic, other than it doesn't provide the law of excluded middle, but you will read that they provide a minimal, intuitionistic logic.
Don't thank me. I've just read some things here and there, and listened. Others can provide expert knowledge.
My findings with regard this question are below.
I found in the Clemens Ballarin slides, slide 20.:
Meta logic: The logic used to formalize another logic.
Example: Mathematics used to formalize derivations in formal logic.
and it is put in parallel with:
Meta language: The language used to talk about another language.
Examples: German in a Spanish class, English in an English class.
Wikipedia has an entry on Metalogic, one section is Metalanguage - Object language:
In metalogic, formal languages are sometimes called object languages.
The language used to make statements about an object language is
called a metalanguage. This distinction is a key difference between
logic and metalogic. While logic deals with proofs in a formal system,
expressed in some formal language, metalogic deals with proofs about a
formal system which are expressed in a metalanguage about some object
language.
And here is slide 21 from Ballarin:
I am trying to learn the decorator design pattern.
The scenario i have though for a good use and to learn coding it is as follows:
A command line output program. The decorators will wrap an outputText class and add additional ability to the output such as text colour, bold text, blinking text etc.
Would this be considered a good use of this pattern or am i missing the point of it?
I think your idea is sound. It's very similar to the text editor sample given in the GoF book.
In that book they use the example of a text editor, with classes for drawing windows, bolding text, etc. They use examples for the decorator pattern in one chapter which mimic what you describe, so I'd say you're on the right track.
so taking it further, you would have a decorator class for italic text, another for bolding text, etc. OK, one could argue that you could have a class to do this for you e.g. TextFormatter, but you just need to use what is right for your situation.
The decorator pattern allows to add features (both structural and behavioarl) by using delegation instead of inheritance. Your example is exactly one good application of it. The benefits are base on the fact that you can have a number of different decorators of a class without having to create a spaghetti graph of inheritance relationships.
This wikipedia page provides further information about this pattern
http://en.wikipedia.org/wiki/Decorator_pattern
Just I am new to Object Modelling.I want to know still there is a need to use Sequence Diagram, Use case Diagram to develop an object model or any other new technology is available?
Update :
CRC (Class,Responsibilites,Collaborator) is very limited ?
It depends on the team or teams you're working with. The chief benefit of UML is that you can share diagrams with other individuals and teams without having to learn each others diagramming language. If the team you're working with doesn't know UML, it may not be worth going down that road unless everyone is interested and you know you'll be working together for a while.
In my experience UML sequence diagrams and object model diagrams are very usefully and generally understood by all. Sequence diagrams in particular have the ability to resolve design issues through the disipline of their construction. I haven't found use case diagrams to be as useful. Requirements are challenging and strongly dependent on human and organizational factors regardless of the methodology.
If you're communcating with non-technical stakeholders, UML is a waste of time because they won't have studied it. Use simple, well annotated diagrams. Colors are very effective.
If your team is all onsite, sometimes there's nothing better than a couple of whiteboards and a freeform diagramming style.
You don't necessarily need these items. They are just aids which are available if you choose to utilise them. They are particularly useful in a business environment where you need to articulate your architecture to fellow developers, but you can choose to use whatever you like, inc. your own personal standards or no standards at all!
"any other new technology is available?"
No.
UML pretty much dominates. A classic ERD is just a specialized class diagram that omits the method box from each class. Also, classic ERD's use crows feet instead of text annotation for cardinality and optionality. So ERD's are actually part of UML.
You can read about OPM, if you want something slightly different. They appear to combine an activity diagram and a class diagram into one thing: a process-data diagram.
I'm looking for some visuals for a presentation to illustrate the principles of oop in a simple-to-grasp way.
I want to avoid saying stuff like "an object is a software bundle of related state and behavior".
Has anyone seen a non-jargon-y illustrated guide to OOP?
O'Reilly's book Head First Object-Oriented Analysis and Design may fullfil your needs
The illustrations in Grady Booch's book Object Oriented Analysis & Design with Applications are pretty good , and quite funny!
Well, I just thought of cars as an example of OO design. There's a fixed interface: accelerator, brake, clutch, steering wheel, gears, lights, indicators and so on. There's also different implementations of the underlying 'object': petrol, hybrid, electric. Inheritance - manual transmission inherits from automatic transmission but adds a gear lever and clutch.