Обсуждение:PlantUML: различия между версиями

Материал из Поле цифровой дидактики
Нет описания правки
Нет описания правки
Метка: ручная отмена
 
(не показано 7 промежуточных версий этого же участника)
Строка 72: Строка 72:
</uml>
</uml>


== ? ==
<uml>
<uml>
@startuml
@startuml
Строка 81: Строка 82:
@enduml
@enduml
</uml>
</uml>
== ==
<uml>
@startuml
actor actor
agent agent
artifact artifact
boundary boundary
card card
cloud cloud
component component
control control
database database
entity entity
file file
folder folder
frame frame
interface  interface
node node
package package
queue queue
stack stack
rectangle rectangle
storage storage
usecase usecase
@enduml
</uml>
== DB ==
* https://gist.github.com/QuantumGhost/0955a45383a0b6c0bc24f9654b3cb561
* https://www.openriskmanual.org/wiki/Special:Version


<uml>
<uml>
@startuml
@startuml
scale .5
' uncomment the line below if you're using computer with a retina display
!include <osa/user/audit/audit>
' skinparam dpi 300
'beware of 'hat-sprite'
!define Table(name,desc) class name as "desc" << (T,#FFAAAA) >>
!include <osa/user/black/hat/hat-sprite>
' we use bold for primary key
!include <osa/user/blue/blue>
' green color for unique
!include <osa/user/blue/security/specialist/specialist>
' and underscore for not_null
!include <osa/user/blue/sysadmin/sysadmin>
!define primary_key(x) <b>x</b>
!include <osa/user/blue/tester/tester>
!define unique(x) <color:green>x</color>
!include <osa/user/blue/tie/tie>
!define not_null(x) <u>x</u>
!include <osa/user/green/architect/architect>
' other tags available:
!include <osa/user/green/business/manager/manager>
' <i></i>
!include <osa/user/green/developer/developer>
' <back:COLOR></color>, where color is a color name or html color code
!include <osa/user/green/green>
' (#FFAACC)
!include <osa/user/green/operations/operations>
' see: http://plantuml.com/classes.html#More
!include <osa/user/green/project/manager/manager>
hide methods
!include <osa/user/green/service/manager/manager>
hide stereotypes
!include <osa/user/green/warning/warning>
 
!include <osa/user/large/group/group>
' entities
!include <osa/users/blue/green/green>
 
!include <osa/user/white/hat/hat>
Table(user, "user\n(User in our system)") {
primary_key(id) INTEGER
not_null(unique(username)) VARCHAR[32]
not_null(password) VARCHAR[64]
}
 
Table(session, "session\n(session for user)") {
primary_key(id) INTEGER
not_null(user_id) INTEGER
not_null(unique(session_id)) VARCHAR[64]
}
 
Table(user_profile, "user_profile\n(Some info of user)") {
primary_key(user_id) INTEGER
age SMALLINT
gender SMALLINT
birthday DATETIME
}
 
Table(group, "group\n(group of users)") {
primary_key(id) INTEGER
not_null(name) VARCHAR[32]
}
 
Table(user_group, "user_group\n(relationship of user and group)") {
primary_key(user_id) INTEGER
primary_key(group_id) INTEGER
joined_at DATETIME
}


listsprites
' relationships
' one-to-one relationship
user -- user_profile : "A user only \nhas one profile"
' one to may relationship
user --> session : "A user may have\n many sessions"
' many to many relationship
' Add mark if you like
user "1" --> "*" user_group : "A user may be \nin many groups"
group "1" --> "0..N" user_group : "A group may \ncontain many users"
@enduml
@enduml
</uml>
</uml>

Текущая версия от 13:19, 21 ноября 2023