Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Design Use Cases architecture #117

Closed
warriordog opened this issue Sep 29, 2023 · 2 comments · Fixed by #130
Closed

Design Use Cases architecture #117

warriordog opened this issue Sep 29, 2023 · 2 comments · Fixed by #130
Assignees
Labels
area:docs Affects or applies to the documentation type:research Research or design project, not direct work

Comments

@warriordog
Copy link
Owner

warriordog commented Sep 29, 2023

Business logic within ActivityPubSharp is based on a collection of small, atomic "use cases" that each implement a high-level function. Two types of use cases exist: high-level and low-level. High-level use cases look much like you would expect. They are highly abstracted from the library internals and represent a distinct function that user may wish to perform.

Low-level use cases, on the other hand, deviate from the typical pattern. They provide thin abstractions over simple routines and functions that would normally be implemented as services or mappers. We take this unusual approach because ActivityPubSharp is first and foremost a library, with a distinct expectation of being wrapped by even higher level business logic or 3rd party integrations. Other patterns are too rigid and would force all library users to adopt the same design, which may not even be possible. To ease usage and integration, we adopt library users as an additional first-class user type alongside the actual end users. High-level cases are for end users, low-level cases are for library users.

All use cases, low or high, share the following traits:

  • Stateless
  • Have a public interface and separate implementation class
  • Injected through DI as singletons
  • Self-contained, but can compose over other use cases through DI
  • Accept a dedicated options type, which exposes static configuration and extension hooks

Depends on #122

@warriordog warriordog added area:meta Affects or applies to the repository, project management, or policies type:chore Code cleanup, formatting, organizational refactor, or other non-feature chores labels Sep 29, 2023
@warriordog warriordog self-assigned this Sep 29, 2023
@warriordog warriordog added type:research Research or design project, not direct work and removed type:chore Code cleanup, formatting, organizational refactor, or other non-feature chores labels Sep 29, 2023
@warriordog warriordog added the status:soft-blocked This issue is blocked from completion, but some work can procede. label Oct 2, 2023
@warriordog
Copy link
Owner Author

Added new branch to track this and related work. WIP design documents can be committed here, in the docs section.

@warriordog
Copy link
Owner Author

Updated description based on latest concept from the branch

@warriordog warriordog added area:docs Affects or applies to the documentation and removed area:meta Affects or applies to the repository, project management, or policies status:soft-blocked This issue is blocked from completion, but some work can procede. labels Nov 5, 2023
warriordog added a commit that referenced this issue Nov 5, 2023
warriordog added a commit that referenced this issue Nov 5, 2023
* Design and document the use-case based architecture
* Create a list of high-level use cases based on AS and AP specs
* Fix color palette in VSCode's Draw.IO extension

Resolves #117
Resolves #122
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:docs Affects or applies to the documentation type:research Research or design project, not direct work
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant