Thursday, April 3, 2014

More on UML Modelling with PlantUML

Here an excellent explanation of the different types of dependencies amongst classes.

Here are all the sort of relationships you can draw.
As a simple reminder, Composition, Aggregation, Dependency, Association are in decreasing order of "tight coupling" between 2 classes.

  • Composition = B cannot exist without A
  • Aggregation = B is a part of A
  • Dependency = change in B affects A
  • Association = very loose relationship

@startuml
left to right direction
Class01 <|-- Class02 : Extension
Class001 "1" *-- "many" Class002 : contains (one to many)
Class03 *-- Class04  : Composition
Class05 o-- Class06 : Aggregation
Class07 .. Class08 : Dependency
Class09 -- Class10 : Association
Class11 <|.. Class12 : Implements
Class13 --> Class14: Unidirectional Association
Class15 ..> Class16: Unidirectional Dependency
Class19 *--> Class20: Unidirectional Composition
Class21 -- Class21: Reflexive Association
@enduml






Wednesday, April 2, 2014

plantuml : quick UML diagrams (with Eclipse plugin available)

Follow installation instructions here:
http://plantuml.sourceforge.net/graphvizdot.html


you MUST install Grephvz 2.28 (NOT 2.30, it will not work)
I installed to C:\pierre\Graphviz 2.28\

Then you must declare the environment variable GRAPHVIZ_DOT=C:\pierre\Graphviz 2.28\bin\dot.exe

Then copy the  plantuml.jar to a folder c:\pierre\plantuml

Then open a new CMD window, cd c:\pierre\plantuml,  and run:
java -jar plantuml.jar -testdot 
It should show success. If not, scream.

At this point you can run "java -jar plantuml.jar" and if you place any .pu file in the c:\pierre\plantuml folder, it shall be converted to a png file.

try this:

@startuml
Object <|-- ArrayList
@enduml


you should get this:





Pretty simple.... but don't expect it to compete with a Rational Rose....

More on UML Class Diagrams: http://en.wikipedia.org/wiki/Class_diagram








Tuesday, April 1, 2014

JKS check expiration date

Use the -v option with the keytool -list command, and look at the "until" field:


keytool -keystore /opt/oracle/certs/acme.com.jks -v -list

Alias name: acme.com
Creation date: Jun 5, 2013
Entry type: PrivateKeyEntry
Certificate chain length: 1
Certificate[1]:
Owner: CN=acme.com, O=acme acme SA, L=Paperopoli, ST=Duckland, C=DU
Issuer: CN=acme Issuing CA 01, DC=acme, DC=com
Serial number: 1fe97622099100001948
Valid from: Mon May 13 13:46:49 CEST 2013 until: Thu Apr 11 13:46:49 CEST 2015
Certificate fingerprints:
         MD5:  2B:97:58:CA:35:18:38:AA:BB:2D:C4:BA:81:56:AD:1E
         SHA1: E4:0D:DD:EE:1F:3E:2B:F7:07:FE:CC:C2:F2:55:05:E6:74:98:26:2A
         Signature algorithm name: SHA1withRSA
         Version: 3