mermaid

I wrote about PlantText before. It is about creating diagrams with code. mermaid is another one from the same category. Recently GitHub has given support for this.

I tried to create some class diagrams with mermaid online editor.

classDiagram

    class ILog {
        <<interface>>
        void LogInfo(string message)
        void LogWarn(string message)
        void LogError(string message)
    }

    class ConsoleLog {
        void LogInfo(string message)
        void LogWarn(string message)
        void LogError(string message)
    }
    ILog --|> ConsoleLog : Implements

    class FileLog {
        void LogInfo(string message)
        void LogWarn(string message)
        void LogError(string message)
    }
    ILog --|> FileLog : Implements

    class AppInsightsLog {
        void LogInfo(string message)
        void LogWarn(string message)
        void LogError(string message)
    }
    ILog --|> AppInsightsLog : Implements

    class IGreetService {
        <<interface>>
        string UserName

        string GetHello()
        string GetBye()
    }

    class GreetService {        
        string UserName
        ILog Logger

        string GetHello()
        string GetBye()
    }
    IGreetService --|> GreetService : Implements
    ILog ..> GreetService : Dependency

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s