Skip to content

Sequence Diagrams

Hasan Kerem Şeker edited this page Apr 27, 2024 · 26 revisions

Block User

sequenceDiagram
    Registered User->>+ UserController: get(username)
    Activate Registered User
    UserController->>+ Database: get the user with given username from database
    alt user fetched successfully
        Database-->>UserController: Registered User Data
        UserController -->> Registered User: Registered User Object
    else 
        Database-->>-UserController: failure
        UserController-->>-Registered User: failure
    end
    Registered User ->>+ Database: blockUser(Registered User Object)
    alt block action is saved to database
        Database-->>Registered User: success
    else
        Database-->>-Registered User: failure
    end
    Deactivate Registered User

Loading

Search Post

sequenceDiagram
    participant RegisteredUser
    participant SearchEngine
    participant WikiData
    participant ContentController
    participant Database

    Activate RegisteredUser

    RegisteredUser ->> SearchEngine : search keyword, createFilter()
    Activate SearchEngine

    SearchEngine ->> WikiData : query(keyword)
    Activate WikiData

    WikiData -->> SearchEngine : return List<WikiData_Entity>
    Deactivate WikiData

    SearchEngine ->> RegisteredUser : ask for WikiData_Entity selection

    RegisteredUser -->> SearchEngine : selected WikiData_Entity

    SearchEngine ->> SearchEngine : updateSearchHistory(WikiData_Entity)

    SearchEngine ->> WikiData : get_keywords(WikiData_Entity)
    Activate WikiData

    WikiData ->> SearchEngine : return new_keyword_list<keyword>
    Deactivate WikiData

    SearchEngine ->> ContentController : find(new_keyword_list)
    Activate ContentController
    ContentController->> Database: get matching content
    Activate Database
    Database -->> ContentController : return List<Post>
    Deactivate Database
    ContentController -->> SearchEngine : return List<Post>
    Deactivate ContentController

    SearchEngine ->> SearchEngine : weight(post_list, weights)

    SearchEngine ->> RegisteredUser : filter(post_list, filter)
    Deactivate SearchEngine
    Deactivate RegisteredUser

Loading

Bookmark Post

sequenceDiagram
    Registered User->>+Post: bookmarkPost(user)
    Activate Registered User
    Post->>+ Database: save bookmark action into database
    alt saving is successful
        Database-->>Post: success
        Post-->>Registered User: success
    else 
        Database-->>-Post: failure
        Post-->>-Registered User: failure
    end
    Deactivate Registered User
Loading

Comment on Content

sequenceDiagram
    actor Registered User as Registered User
    Registered User->>+Content: addComment(string)
    Content->>+ Database: save comment into database
    alt saving is successful
        Database-->>Content: success
        Content-->>Registered User: success
    else 
        Database-->>-Content: failure
        Content-->>-Registered User: failure
    end
Loading

Like Post

sequenceDiagram
    Registered User->>+Post: likePost(user)
    Activate Registered User
    Post->>+ Database: save like action into database
    alt saving is successful
        Database-->>Post: success
        Post-->>Registered User: success
    else 
        Database-->>-Post: failure
        Post-->>-Registered User: failure
    end
    Deactivate Registered User
Loading

Follow User

sequenceDiagram
    Registered User->>+ UserController: get(username)
    Activate Registered User
    UserController->>+ Database: get the user with given username from database
    alt user fetched successfully
        Database-->>UserController: Registered User Data
        UserController -->> Registered User: Registered User Object
    else 
        Database-->>-UserController: failure
        UserController-->>-Registered User: failure
    end
    Registered User ->>+ Database: followUser(Registered User Object)
    alt following action is saved to database
        Database-->>Registered User: success
    else
        Database-->>-Registered User: failure
    end
    Deactivate Registered User
Loading

Create Post

sequenceDiagram
    Registered User->>+ContentController: create(text: String, author: RegisteredUser, title: String, image: Image)
    Activate Registered User
    ContentController->>+ Database: save create action into database
    alt saving is successful
        Database-->>ContentController: success
        ContentController-->>Registered User: success
    else 
        Database-->>-ContentController: failure
        ContentController-->>-Registered User: failure
    end
    Deactivate Registered User
Loading

BOUNSWE2024 - G11

Logo Turquiz App

⏳ Status

DONE

🧑🏼‍💻 Team

📝 Diagrams

📆 Lab Reports

📆 Meeting Notes

📍 Milestones

📎 Planning

📚 User Scenarios / Stories

📚 Resources

🔎 Research

🗂️ Templates

Clone this wiki locally