This gist is an open-ended template for defining a Domain Model for the Chain Links application that accompanies The Language of API design series in API Design Matters. Below are several key elements of a Domain Model, with a brief desccription of each, and some content to spark your own responses. Download a copy of this template as Markdown and fill in each section with your understanding and interpretation of the domain model.
(The application or solution domain that your software product will improve)
A social media app in which fan fiction authors can compose content, mix other authors' existing content in new ways, to author and share new stories or continue existing story lines. Each story exists within a story universe. Characters (of various species) can span universes and have roles in many stories.
(Defining a context helps put boundaries around the problem and the solution: what is in scope, what we ignore.)
Reading, authoring, composing, and sharing fan fiction stories.
Out of scope for the context of the Language of API Design series series (but things that may be in scope in a commercially viable product):
- Content moderation, plagiarism detection, content safety ratings, censorship, and banning authors
- Content tagging, comenting, and star rating systems
- Flexible Copyright management: via via Terms of Use, all authors must consent to a single Creative Commons BY-NC-SA copyright
- Copyright infringement controls: via Terms of Use, authors agree to only contribute original work, not other's copyrighted work.
- Monetization: authors cannot put up paywalls to access their content, or sell other's work
- Crowd-sourced editorial actions (approving changes to existing published story elements)
- Gamification, rewards, incentives for contributing
- Author levels with earned trust/permissions (such as changing/editing previously published content)
- ... What other domain-specific scope limitations can we impose to narrow the context of the solution?
(The "entities" or “things” in the domain. Describe the properties/attributes of each resource.)
- Stories, a.k.a. story lines. For this product, stories are called "chains" (branding name). Properties:
- name
- universe
- authors
- characters
- story elements (chain links)
- ...
- Story elements - reusable content that may be added to other stories.
For this product, story elements are called "chain links" (branding name).
Chain links may be strung together to create chains.
Chain links may be plain text, rich text, images, audio, video. Properties:
- author
- story lines in which this story element is used
- type
- content
- ...
- Authors. Properties:
- ...
- ... What other resources do you see? (Hint: view the scenario and list the key nouns.)
- ...
(Someone or something that interacts with the system.)
- ... What actors can you identify?
- ...
(The activity that an actor performs in the system when interacting with the resources. Behaviors are the business actions within our domain’s contexts—what the users do.)
- Authors can register on the site
- Authors can update their profile
- Authors can draft new story elements
- Authors can add story elements to existing story lines
- ... what other actions and behaviors are required for the application?
- ....
(Conditions which put bounds on our context. Constraints can be large and small, such as a bound for our contexts, a system invariant that is always true before, during, and after a behavior, or a minimum/maximum value range of a property in a value object.)
- Story elements are limited to 1,000 words
- Images used in story elements are limited to 5,000 pixels along the largest dimension, and limited to JPEG and PNG images (no raw, TIFF, GIF, BMP, ICO, or other image types)
- Authors are limited to 1,000 media for free tier, 100,000 media files for paid tiers. (This is not a photo sharing site.)
- Story chains are limited to 1,000 story elements
- Story titles are limited to 120 characters
- Published story element contents are immutable, although this may change in the future when authors can earn change permissions
- ... what other actions and behaviors are required for the application?
- ...