ProductPromotion
Logo

Clojure

made by https://0x3d.site

GitHub - friemen/domaintypes: Modeling domain data on the basis of Clojure records.
Modeling domain data on the basis of Clojure records. - friemen/domaintypes
Visit Site

GitHub - friemen/domaintypes: Modeling domain data on the basis of Clojure records.

GitHub - friemen/domaintypes: Modeling domain data on the basis of Clojure records.

domaintypes

Modeling domain data on the basis of Clojure records.

Build Status

Motivation

Default Clojure records are a more formal (and performant) way for describing and keeping domain data than pure maps. To model and discuss domain data types with domain experts it is often desirable to attach domain type information to fields of records. It is also beneficial to formalize the range of admissable values for each field, therefore one should be able to attach constraints on different levels of the domain types model.

Finally it would be nice to generate a graphical overview for a domain type model, e.g. a UML class diagram.

The core project offers functionality to define simple types (instances represent scalar values) and complex types (instances represent structured data).

The resulting plain Clojure records do not put constraints on the data that one can store in instances. Instead a valid? function checks on-demand if the data meets the constraints, for instance right before data is persisted in a database, or after deserialization from a message received from a remote part of the system.

Projects

  • core provides the macros for defining simple types and complex types, plus some functionality for validation.

  • lein-domaintypesdoc is a leiningen plugin that generates PlantUML class diagram and PNG image from namespaces containing domain types.

  • samples contains a demonstration how the macros are used.

Usage

In your project.clj add a dependency

[domaintypes/core "1.0.1"]

and a plugin dependency

[domaintypes/lein-domaintypesdoc "1.0.1"]

Specify additionally with the :domaintypesdoc-for key which namespaces should be searched for domain types to be included in a UML class diagram. See the sample project.clj.

A sample model would be described like this

    (defsimpletype required-string "A non-blank string" string? #(> (count %) 0))
    (defsimpletype task-status "Status of a Task" #{:new :in-progress :done})

    (defcomplextype Member [name {:dt required-string}])

    (defcomplextype Team [members {:dt Member :card [1 any]}])

    (defcomplextype Task [description {:dt required-string}
                          status      {:dt task-status}
                          assignee    {:dt Member :nillable true}])

    (defcomplextype Sprint [name  {:dt required-string}
                            tasks {:dt Task :card [0 any]}])

A corresponding graphical overview of complex types looks like this

UML diagram of complextypes

The image file in the samples/target dir is created by the command

$ lein domaintypesdoc

License

Copyright 2013 F.Riemenschneider

Distributed under the Eclipse Public License, the same as Clojure.

More Resources
to explore the angular.

mail [email protected] to add your project or resources here 🔥.

Related Articles
to learn about angular.

FAQ's
to learn more about Angular JS.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory