// http://www.nomnoml.com/
#direction: TD

[<package> model|
    [ «enumeration»
      + TextureFormat
    | 
      JPEG 
      PNG
    ]
    [+ Texture|...]
    [Sha256|...]
]

[<package> persistency |
	
    [+ DataStore|...]
    
    [<package> result|
      [+ TextureFileResult|...]
      [+ TextureFileError|...]

      [+ TextureFileResult|...] -/- [+ TextureFileError]
    ]
    
    [<package> search|
    	[+ Query|...]
    ]
    
    [<package> image_convert|
    	[+ ConvertConfig|...]
        |
        + generate_preview(input, format, config) : ...
    ]
    
    [search] -/- [image_convert]
]

[<package> protocol| 
	[<abstract> + ProtocolHandler|...]
    [+ ProtocolConfig|...] 
    
    [+ ProtocolHandler] -/- [+ ProtocolConfig] 
    
    [<package> result|
      [+ ProtocolResult|...] 
      [+ ProtocolError|...] 
      [+ ReplaceTextureStatus|...]

      [+ ProtocolResult] -/- [+ ProtocolError] 
      [+ ProtocolError]  -/- [+ ReplaceTextureStatus]
    ]
    |
    + listen_forever(handler : &ProtocolHandler) : ...
]


[<package> main|
	[ServerState|...] -- [<note> 
      implements 
      protocol::ProtocolHandler
    ]
    |
    + main() 
]

[main] --> [model]
[main] --> [protocol]
[main] --> [persistency]

[protocol] --> [model]
[persistency] --> [model]