Class Diagram - bounswe/bounswe2024group1 GitHub Wiki

Class Diagram

Below is our class diagram for the Programming Language Forum.

classDiagram
    class User {
        -Long id
        -String username
        -String email
        -String password
        -String firstName
        -String lastName
        -String country
        -String bio
        -Integer reputationPoints
        -ExperienceLevel experienceLevel
        -Boolean isVerified
        -Integer followersCount
        -Integer followingCount
        -Integer questionCount
        -Integer answerCount
        +register()
        +login()
        +resetPassword()
        +updateProfile()
        +follow(User)
        +unfollow(User)
    }

    class Question {
        -Long id
        -String title
        -String content
        -DateTime createdAt
        -DateTime updatedAt
        -Integer rating
        -Integer viewCount
        -List~String~ photos
        -DifficultyLevel difficultyLevel
        -Boolean isDeleted
        -Integer commentCount
        -Boolean bookmarked
        -Integer selfRating
        +create()
        +update()
        +delete()
        +upvote()
        +downvote()
        +bookmark()
        +removeBookmark()
    }

    class Answer {
        -Long id
        -String content
        -DateTime createdAt
        -DateTime updatedAt
        -Integer rating
        -Integer selfRating
        -List~CodeSnippet~ codeSnippets
        +create()
        +update()
        +delete()
        +upvote()
        +downvote()
    }

    class Tag {
        -String tagId
        -String name
        -String description
        -TagType type
        -String logoUrl
        -Integer questionCount
        -Integer followerCount
        -Boolean following
        -String photo
        +create()
        +update()
        +follow()
        +unfollow()
    }

    class CodeSnippet {
        -Long id
        -String code
        -Language language
        -String input
        -Boolean isExecutable
        +execute() ExecutionResult
    }

    class ExecutionResult {
        -String output
        -String errors
        -Number executionTime
        -ExecutionStatus status
    }

    class ProgrammingLanguageTag {
        -String logoImage
        -String author
        -String inceptionYear
        -String fileExtension
        -String officialWebsite
        -String stackExchangeTag
    }

    class SoftwareLibraryTag {
        -String officialWebsite
        -String stackExchangeTag
    }

    class ComputerScienceTermTag {
        -String stackExchangeTag
    }

    class ProgrammingParadigmTag {
        -String stackExchangeTag
    }

    class UserDefinedTag

    class DifficultyLevel {
        <<enumeration>>
        EASY
        MEDIUM
        HARD
    }

    class TagType {
        <<enumeration>>
        PROGRAMMING_LANGUAGE
        SOFTWARE_LIBRARY
        COMPUTER_SCIENCE_TERM
        PROGRAMMING_PARADIGM
        USER_DEFINED
    }

    class Language {
        <<enumeration>>
        C
        CSHARP
        CPP
        GO
        JAVA
        JAVASCRIPT
        PYTHON3
    }

    class ExecutionStatus {
        <<enumeration>>
        SUCCESS
        ERROR
        TIMEOUT
    }

    class ExperienceLevel {
        <<enumeration>>
        BEGINNER
        INTERMEDIATE
        ADVANCED
    }

    User "1" -- "0..*" Question : creates >
    User "1" -- "0..*" Answer : writes >
    User "0..*" -- "0..*" User : follows >
    User "0..*" -- "0..*" Tag : follows >
    Question "1" -- "0..*" Answer : has >
    Question "0..*" -- "0..*" Tag : tagged with
    Question "1" *-- "0..*" CodeSnippet : contains >
    Answer "1" *-- "0..*" CodeSnippet : contains >
    CodeSnippet "1" -- "0..1" ExecutionResult : produces >
    Tag <|-- ProgrammingLanguageTag
    Tag <|-- SoftwareLibraryTag
    Tag <|-- ComputerScienceTermTag
    Tag <|-- ProgrammingParadigmTag
    Tag <|-- UserDefinedTag
    Question "1" -- "1" DifficultyLevel : has >
    Tag "1" -- "1" TagType : has >
    CodeSnippet "1" -- "1" Language : written in >
    ExecutionResult "1" -- "1" ExecutionStatus : has >
    User "1" -- "1" ExperienceLevel : has >