ClassUMLDiagram of CMPE451 - bounswe/bounswe2025group5 GitHub Wiki
classDiagram
%% ---------------------------
%% Package: User Management
%% ---------------------------
class RegisteredUser {
- email: String
- username: String
- password: String
- userId: int
- posts: List~Post~
- badges: List~Badge~
- goals: List~WasteGoal~
+ login(email: String, password: String): boolean
+ resetPassword(email: String): void
+ deleteAccount(): boolean
+ logout(): void
+ createWasteGoal(name: String, duration: double, type: String, amount: double, unit: String): void
+ logWaste(amount: double, type: String, unit: String): void
+ deleteWasteGoal(goalId: int): boolean
+ completeWasteGoal(goalId: int): Badge
+ viewChallenges(): List~Challenge~
+ selectChallenge(challengeId: int): Challenge
+ follow(userId: int): boolean
+ unfollow(userId: int): boolean
}
class Moderator {
+ moderatePost(postId: int): void
+ reviewReports(reportId: int): void
+ approveRequestedChallenge(challengeId: int): int
}
RegisteredUser <|-- Moderator
%% Follow graph (self-association via Follow entity)
class Follow {
- followerId: int
- followeeId: int
- since: Date
}
RegisteredUser "1" -- "*" Follow : follows >
Follow "*" -- "1" RegisteredUser : > followee
%% ---------------------------
%% Package: Preferences & Profile
%% ---------------------------
class Profile {
- userName: String
- photo: Image
- biography: String
- displayedBadges: List~Badge~
- locale: String
+ getPhoto(): Image
+ setPhoto(photo: Image): boolean
+ getBiography(): String
+ setBiography(biography: String): String
+ editProfile(flag: String): void
+ saveBadges(badges: List~Badge~): List~Badge~
+ selectBadges(badges: List~Badge~): List~Badge~
+ updateDispBadges(badges: List~Badge~): void
}
RegisteredUser --> Profile : has
%% ---------------------------
%% Package: Post & Forum (with semantic search + kindness reminder cue)
%% ---------------------------
class Post {
- postId: int
- content: String
- attachments: List~String~
- tags: List~String~
- timestamp: Date
- authorUserId: int
- likeCount: int
- shareCount: int
- savedBy: List~int~
}
class Comment {
- commentId: int
- content: String
- timestamp: Date
- authorUserId: int
+ editComment(newContent: String): boolean
}
class Like {
- likeId: int
- userId: int
- postId: int
- timestamp: Date
}
class ForumFeed {
- feedId: int
- posts: List~Post~
+ getPosts(): List~Post~
+ createPost(content: String, attachments: List~String~, tags: List~String~): boolean
+ selectPost(postId: int): Post
+ deletePost(userId: int, postId: int): boolean
+ likePost(userId: int, postId: int): void
+ commentOnPost(userId: int, postId: int, comment: Comment): void
+ savePost(userId: int, postId: int): boolean
+ sharePost(userId: int, postId: int): boolean
+ reportPost(postId: int, reason: String): void
+ semanticSearch(prompt: String): List~Post~
+ showKindnessReminder(): void
}
Post "1" --> "*" Comment : has
Post "1" --> "*" Like : has
ForumFeed "1" --> "*" Post : contains
RegisteredUser --> ForumFeed : accesses
User --> "*" ForumFeed : views
%% ---------------------------
%% Package: Waste Tracking
%% ---------------------------
class WasteGoal {
- goalId: Integer
- date: LocalDateTime
- duration: int
- restrictionAmountGrams: double
- completed: Integer
- percentOfProgress: Double
+ visualize(): Image
+ checkCompletion(): boolean
}
class WasteLog {
- logId: int
- quantity: int
- date: LocalDateTime
- goalId: int
- userId: int
}
class WasteItem {
- id: Integer
- name: String
- displayName: String
- weightInGrams: double
}
class WasteType {
- id: Integer
- name: String
}
WasteGoal "1" -- "*" WasteLog : contains
WasteLog "*" -- "1" WasteItem : of
WasteGoal "*" -- "1" WasteType : has type
WasteItem "*" -- "1" WasteType : has type
RegisteredUser --> "*" WasteGoal : creates
RegisteredUser --> "*" WasteLog : logs
%% ---------------------------
%% Package: Reporting, Feedback & Challenges
%% ---------------------------
class Report {
- reportId: int
- postId: int
- reason: String
- reportDate: Date
- status: String
+ resolve(reportId: int): boolean
}
class Feedback {
- feedbackId: int
- userId: int
- type: String
- message: String
- createdAt: Date
- status: String
}
RegisteredUser --> "*" Report : submits
RegisteredUser --> "*" Feedback : submits
Moderator --> "*" Report : reviews
class Challenge {
- challengeId: int
- title: String
- description: String
- startDate: Date
- endDate: Date
- status: String
- participants: Map~int, double~
+ joinChallenge(challengeId: int): boolean
+ leaveChallenge(challengeId: int): boolean
+ requestChallenge(description: String, userId: int): int
+ getLoggedAmounts(userId: int, amount: double): void
+ updateLoggedAmounts(userId: int, loggedWaste: double): void
+ deleteUserProgress(userId: int): int
+ rewardWinners(): void
+ viewLeaderboard(leaderboardId: int): Leaderboard
}
class Leaderboard {
- leaderboardId: int
- type: String %% Plastic, Organic, Paper, Metal, Glass
- metric: String
- rankedUsers: List~int~
+ updateRanking(userId: int): void
}
Moderator --> "*" Challenge : approves
RegisteredUser --> "*" Challenge : participates
RegisteredUser --> "*" Challenge : requests
Challenge --> "1" Leaderboard : maintains
%% ---------------------------
%% Package: Badges (catalog + assignment)
%% ---------------------------
class Badge {
- badgeId: int
- name: String
- description: String
- criteria: String
}
class BadgeCatalog {
- badges: List~Badge~
+ listBadges(): List~Badge~
+ getBadge(badgeId: int): Badge
}
WasteGoal --> Badge : awards
Challenge --> Badge : awardsTop3
RegisteredUser --> "*" Badge : earns
Profile --> "*" Badge : displays
BadgeCatalog --> "*" Badge : contains
%% ---------------------------
%% Package: Notifications
%% ---------------------------
class Notification {
- notificationId: int
- userId: int
- type: String
- sourceId: int
- message: String
- timestamp: Date
- read: Boolean
+ markAsRead(notificationId: int): void
}
RegisteredUser --> "*" Notification : receives
%% ---------------------------
%% Package: Standardization (W3C Activity Streams 2.0)
%% ---------------------------
class Activity {
- activityId: int
- type: String %% "Create","Like","Share","Add(Save)","Join","Follow","Comment"
- actorId: int
- objectType: String
- objectId: int
- targetId: int
- timestamp: Date
}
RegisteredUser --> "*" Activity : performs
Activity --> Notification : triggers
%% ---------------------------
%% Cross-Package Associations
%% ---------------------------
User --> "*" Profile : views