A simple, but non-obvious approach to setting boundaries.
Project description
The first python package to jump across the English Channel!
This package attempts to implement the “functional core, imperative shell” pattern described in Gary Bernhardt’s talk on Boundaries, using some ideas found in the Ruby obvious project.
Functional Core, Imperative Shell
The basic idea is that your core domain model implements business logic using functional techniques, with immutable values and copy-on-write. The functional core is wrapped by an imperative shell which drives the core models and interacts across the boundary with the outside world through “primitive” values. The immutable domain models can be easily converted to primitive data structures whose state has no affect on the immutable core.
nonobvious.models and nonobvious.fields provide a declarative modeling language, similar to Django’s model objects, but without an ORM. We can easily use validators and adaptors from the valideer project to ensure that the models are always in a valid state and can easily be constructed from standard python data structures.
By making use of concon.frozendict, concon.frozenlist, and concon.frozenset within model adaptors allows us to model complex data structures guaranteed to be correctly formed at all times.
As for the imperative shell, at present, you’re on your own!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file nonobvious-0.1.tar.gz
.
File metadata
- Download URL: nonobvious-0.1.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 949b1fb5fb344ba0c05df1cfc37fe4340ad1f1a798a19750682a0c8670f47685 |
|
MD5 | f9e6c2ff94f340514165227d319a9a2b |
|
BLAKE2b-256 | d74e8abf38ea4acc8a220ca5429acc717a6818767b1813c54175d842f730d50c |