You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
56 lines
1005 B
56 lines
1005 B
@startuml
|
|
class User {
|
|
+ name : string
|
|
}
|
|
|
|
User "1" --> "*" User: friends
|
|
User "1" --> "*" Notification: notifications
|
|
User "1" --> "*" Ask: friendRequests
|
|
class Notification {
|
|
- text : string
|
|
}
|
|
|
|
interface INotifier {
|
|
+ notify() : void
|
|
}
|
|
|
|
INotifier --|> Observer
|
|
|
|
abstract class UserManager {
|
|
- currentUser : User
|
|
+ deleteFriend(userId : int) : void
|
|
+ addFriend(userId : int) : void
|
|
+ respondToFriendRequest(requestId : int, choice : bool) : void
|
|
+ getFriends(userId : int) : User[]
|
|
}
|
|
|
|
class Ask {
|
|
- fromUser : int
|
|
- toUser : int
|
|
}
|
|
|
|
Ask --|> Subject
|
|
|
|
abstract class Subject {
|
|
+ attach(o : Observer) : void
|
|
+ detach(o : Observer) : void
|
|
+ notify() : void
|
|
}
|
|
|
|
Subject "1" --> "*" Observer
|
|
interface Observer {
|
|
+ update() : void
|
|
}
|
|
|
|
UserManager ..> User
|
|
UserManager o-- IUserRepository
|
|
UserManager o-- INotifier
|
|
|
|
interface IUserRepository {
|
|
+ findByUsername(username : string) : User
|
|
+ addUser(user : User) : bool
|
|
}
|
|
|
|
IUserRepository ..> User
|
|
@enduml
|