Positioning blocks of PlantUML diagram - uml

I'm trying to repeat a diagram using PlantUML. The diagram is like this:
I got stuck at trying to add more connections and make them look decent.
I started with object digram and came to something like this link to online diagram.
As soon as I start adding more connections, blocks break into chaos.
Then I tried component diagram. I started from this diagram and got to something like this in trying to add one more blocks and connections: link to online diagram.
The result is not satisfactory. I would appreciate any help in trying to add one more block to the diagram.

I always try to keep it simple, using --> (vertical) layout as much as possible. That is the optimal strategy for the GraphViz algorithm, which is the basis of PlantUML.
The result is different from your original, but I hope you find it readable:
#startuml
'hide empty description
'!pragma layout elk
skinparam rectangleBorderThickness 1
skinparam defaultTextAlignment center
skinparam lifelineStrategy solid
skinparam monochrome true
skinparam style strictuml
hide empty members
skinparam Linetype ortho
rectangle "Базовые модули" as base {
class "Базовые объекты" as baseobjects
class "Делопроизводство\n4.5" as takeoffice
class "Управление\nпроцессами" as workflow
class "Windows-клиент" as windowsclient
class "Управление\nдокументами" as documentmanagement
class "Конструктор\nсогласований" as approvaldesigner
class "Платформа" as platform
class "Служба\n фоновых операций" as worker
}
platform <-- baseobjects
platform <-- workflow
platform <-- takeoffice
platform <-- windowsclient
platform <-- documentmanagement
platform <-- approvaldesigner
windowsclient -up-> approvaldesigner
windowsclient -up-> documentmanagement
windowsclient -up-> baseobjects
windowsclient -up-> takeoffice
windowsclient -up-> workflow
worker <-- approvaldesigner
worker <-- baseobjects
#enduml

Related

What does #:keep mean in Haxe?

I am new to Haxe and playing with the OpenFL Starling Sample code -
I noticed a #:keep metadata before the class declaration. What does it mean?
#:keep class TouchScene extends Scene {
// ...
}
Haxe allows metadata tags on classes and functions.
#:keep is a metadata tag that instructs the compiler's dead code elimination feature not to remove the class or function, even if it believes that the class or function is unused.
There are many other built-in metadata tags.
FYI, for advanced users, you can create schemas and specify your own metadata tags (and parse them using macros). For example, my lazy-props library does exactly this.

UML - How to show a class instantiated by its static main method

It is a Sequence Diagram HowTo question, not a HowTo code.
I am using Visio 2010 and developing >> reverse engineering from Microsoft Dynamics AX 2012 / X++. Yes people its all about how to map static on UML.
My class is instantiated from FORM using at its void static main(). This calls another static method, say construct() which returns an instance of the same class.
I want to show the class (in static methods) and the resulting object separately some like the meta class runs (self msgs) and finally produces the class object which finally takes over. But how will a self msg call return a value ? How do I connect it with the resulting object of the class ? I hope I make enough sense to make you guys understand.
Note, the class is not a static class, but it has a static constructor.
If you want to depict a call to constructor (i.e. static operation that is responsible for creating an object and (usually) returning it as a reply) then you have to use a createMessage construct i.e. a dashed line with an open arrow and the word create on it. While this is not directly stated in specification, usually in such case the arrow points on the lifeline box (rectangle) rather than a line itself (however I've seen information that both notations are correct).
Note that in this case the logic of constructor is hidden (encapsulated) which is a good idea in general.
You can find more details in UML specification in section 17.4, especially 17.4.4.1 and an example in section 17.6.5 on Figure 17.14.
If you want to use a static operation other than constructor and call it without a use of class instance you have to model class as object (after all class is an object itself at least on analytical level). Note that the type of message can be either synchronous or asynchronous depending on your needs.
With this approach you can provide details on how the class handles this function (i.e. what other calls does it make).
For more details see "Applied UML and Patterns" by Craig Larman, section 15.4, Figure 15.20. Note however that Larman suggest a use of <<metaclass>> stereotype. Yet the called object is a class (metaclass is a class whose instance is class so this is not our case) so the stereotype should be <<class>>.

OWL/RDF to UML Converter

I'm new to the concept of OWL/RDF ontologies and thinking it would useful to be able to convert them to UML so I could then generate class skeletons using my IDE. Assuming this is a reasonable thing to do, can you please recommend an approach?
I'm aware that there are OWL/RDF parsers like this one, but I can't find any that will convert to UML.
EDIT:
Based on the comments let me modify the question:
When starting a new project based on an existing ontology is there a way to easily create skeleton classes as a starting point? I do not need to synchronize changes between the ontology and the classes - it is a one time setup that I expect will take a significant amount of copy and paste which strikes me as the wrong approach.
If I'm not using ontologies correctly, can you please explain what their purpose is (if any) in designing class hierarchies?
Here's an example of what I want to implement (except this is only 1 sensor and I need to implement several):
http://www.w3.org/2005/Incubator/ssn/XGR-ssn-20110628/#Smart_product_example
To implement https://github.com/WolfgangFahl/pysotsog/issues/21 I created some conversion code see https://github.com/WolfgangFahl/pysotsog/blob/main/skg/dblp.py. It is currently for the dblp schema at:
https://dblp.org/rdf/schema and a conversion example is at:
plantum online dblp schema
/'
Wolfgang Fahl 2022-11-19
updated 2022-11-19
dblp schema https://dblp.org/rdf/schema
converted from owl to plantuml
'/
title dblp schema https://dblp.org/rdf/schema converted from owl to plantuml updated 2022-11-19
hide circle
package foaf {
class Document {
}
}
package dblp {
note top of AmbiguousCreator
Ambiguous Creator
Not an actual creator, but an ambiguous proxy for an unknown number of unrelated actual creators. Associated publications do not have their true creators determined yet.
end note
class AmbiguousCreator{
}
AmbiguousCreator--Creator:possibleActualCreator
Creator <|-- AmbiguousCreator
note top of Informal
Informal
An informal or other publication.
end note
class Informal{
}
Publication <|-- Informal
note top of Creator
Creator
A creator of a publication.
end note
class Creator{
primaryCreatorName:string
homepage:Document
creatorNote:string
orcid:anyUri
creatorName:string
affiliation:string
awardWebpage:Document
primaryAffiliation:string
primaryHomepage:Document
}
Creator--Publication:editorOf
Creator--AmbiguousCreator:proxyAmbiguousCreator
Creator--Creator:coCreatorWith
Creator--Creator:homonymousCreator
Creator--Publication:authorOf
Creator--Creator:coEditorWith
Creator--Publication:creatorOf
Creator--Creator:coAuthorWith
Entity <|-- Creator
note top of Publication
Publication
A publication.
end note
class Publication{
primarydocumentPage:Document
listedOnTocPage:Document
yearOfEvent:gYear
publishedBy:string
isbn:anyUri
publishersAddress:string
publicationNote:string
title:string
bibtexType:Entry
publishedInBookChapter:string
doi:anyUri
documentPage:Document
numberOfCreators:integer
publishedInSeries:string
publishedInSeriesVolume:string
publishedIn:string
pagination:string
yearOfPublication:gYear
monthOfPublication:string
publishedInJournalVolumeIssue:string
publishedInJournal:string
thesisAcceptedBySchool:string
publishedInJournalVolume:string
publishedInBook:string
}
Publication--Creator:createdBy
Publication--Creator:authoredBy
Publication--Creator:editedBy
Publication--Signature:hasSignature
Publication--Publication:publishedAsPartOf
Entity <|-- Publication
note top of Data
Data
Research data or artifacts.
end note
class Data{
}
Publication <|-- Data
note top of Person
Person
An actual person, who is a creator of a publication.
end note
class Person{
}
Creator <|-- Person
note top of AuthorSignature
Author Signaure
The information that links a publication to an author.
end note
class AuthorSignature{
}
Signature <|-- AuthorSignature
note top of Inproceedings
Inproceedings
A conference or workshop paper.
end note
class Inproceedings{
}
Publication <|-- Inproceedings
note top of Withdrawn
Withdrawn
A withdrawn publication item.
end note
class Withdrawn{
}
Publication <|-- Withdrawn
note top of EditorSignature
Editor Signaure
The information that links a publication to an editor.
end note
class EditorSignature{
}
Signature <|-- EditorSignature
note top of Editorship
Editorship
An edited publication.
end note
class Editorship{
}
Publication <|-- Editorship
note top of Incollection
Incollection
A part/chapter in a book or a collection.
end note
class Incollection{
}
Publication <|-- Incollection
note top of Reference
Reference
A reference work entry.
end note
class Reference{
}
Publication <|-- Reference
note top of Group
Group
A creator alias used by a group or consortium of persons.
end note
class Group{
}
Creator <|-- Group
note top of Signature
Signature
The information that links a publication to a creator.
end note
class Signature{
signatureOrcid:anyUri
signatureDblpName:string
signatureOrdinal:integer
}
Signature--Creator:signatureCreator
Signature--Publication:signaturePublication
note top of Book
Book
A book or a thesis.
end note
class Book{
}
Publication <|-- Book
note top of Entity
Entity
A general, identifiable entity in dblp.
end note
class Entity{
identifier:anyUri
wikipedia:Document
archivedWebpage:Document
wikidata:anyUri
webpage:Document
}
Thing <|-- Entity
note top of Article
Article
A journal article.
end note
class Article{
}
Publication <|-- Article
}
Just create an issue following the links in http://sotsog.bitplan.com if you'd like to get an online version.
https://github.com/WolfgangFahl/pysotsog/blob/main/skg/owl.py
https://github.com/WolfgangFahl/pysotsog/blob/main/skg/schema.py
have a more generic version as of 2023-01-08
Check for UML to OWL converter. It converts UML to RDF/OWL, so it does job in opposite direction, but it can be used as a template for your task. The converter is based on MDA approach, so requires knowledge of it (MOF, ODM, Eclipse EMF, ATL), which is worth to have.
My understanding is that the concept of the "semantic web" is still largely in the visionary stage and will not impact developers for some time. The initial applications seem to be centered around knowledge sharing between humans not machines. Hopefully it moves toward machine-to-machine sharing as there doesn't appear to be any interest in that at this time.

Cannot pass in FlxTypedGroup class param using FlxG.overlap

I want the player to pickup objects in my game using the code below, but I am getting:
Error #1034: Type Coercion failed: cannot convert flixel::FlxSprite#51e1b69 to Player.
...
FlxG.overlap(weapons, players, onPickup)
}
private function onPickup(wep:Weapon, player:Player):Void
{
//access player function
}
I've initialized the players and weapons already as below, and added to the group
players= new FlxTypedGroup<Player>();
weapons= new FlxTypedGroup<Weapon>();
Weapon extends FlxSprite and Player extends FlxTypedGroup<FlxSprite>.
I'm using FlxTypedGroup because I want the player to have multiple sprites associated with it.
Please help so I can access the player class variables!
If I replace player:Player with player:FlxSprite there is no error, but then I can no longer access Player class functions.
I know this is probably a little bit late, but there are a few things you can try:
You could try using FlxSpriteGroup for Player instead of FlxTypedGroup. It may take some work to get it working the way you want.
Also, the reason why it's giving you an error, is because overlap and collide will (by default) drill down through your Groups until it comes to an actual object...
How to explain... If you have a FlxTypedGroup<Player> and your Player object extends FlxTypedGroup<PlayerPart> (if PlayerPart extends FlxSprite or something), when you do FlxG.overlap(weapons, players, onPickup), overlap is NOT going to pass the Player object, it's going to pass the PlayerPart object that overlapped - in fact, it's going to call onPickup once for EVERY PlayerPart object that overlaps a weapon - possibly the same one - this update.
You can use this behavior to your advantage, if you can figure it out - make your Player group contain several PlayerParts but set all of them to allowCollisions = NONE except for one which will be your hitbox, etc.
There's lots of things you can do, it's just figuring out the specifics. Good Luck!

Do I Need To Make A Class Diagram For All Object Instances and Microsoft Methods That I Use?

I have the following classes made in C# in a program called MyGrades:
Menu.cs
Grade.cs
Student.cs
I have the following instances in my Student class:
private Grade test = new Grade(300);
private Grade hwQz = new Grade(700);
In Menu.cs I use the following Microsoft methods and Microsoft Class respectively:
Console.Clear()
Console.WriteLine()
Console.Write()
Console.ReadKey()
ConsoleKeyInfo key = Console.ReadKey();
In Grade.cs I use the following Microsoft methods:
Console.Clear()
Console.WriteLine()
Console.Write()
Console.ReadKey
Do I need to make class diagrams for Console as well as for all my class instances?
The programming language doesn't require you to draw a class diagram.
If your course instructor requires you to draw diagrams, you'll need to ask them exactly what they want.
Generally you should include other classes when they are relevant to understanding the diagram. It is not useful to have everything point to, say, the Logging class. If something especially interacts with the Console that might be relevant.

Resources