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

Add framework documentation #33

Merged
merged 4 commits into from Mar 6, 2023
Merged

Add framework documentation #33

merged 4 commits into from Mar 6, 2023

Conversation

pyromaniac
Copy link
Contributor

No description provided.


_Command_ or _business operation_ or _interaction_ or _use case_ or _application service_ (DDD term) even just _service_ (this term is so ambiguous) is a predefined sequence of programmed actions that can be called by a user (directly in the code or via the API) and modifies the application state. In the scope of this framework, we prefer the _operation_ term though.

These modifications are atomic in the sense that the application state is supposed to be consistent and valid after the operation execution. It might be eventually consistent but the idea is that the application state is valid after the operation execution and in a normal case, there should be no need to call a complimentary operation to make the state valid.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe you are using atomicity and consistency interchangeably in here. They are seperate properties, both of them are wanted in the Operation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand your point tbh. Can you propose a way to rephrase this paragraph please?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From a DBMS background, Atomicity means that your transaction either happens or doesn't happen. Consistency means that things like referential integrity are enforced.

We would like the transactions (in this case, operations) to rollback the changes if an operation failed midway, and thus atomic. The consistency aspect is more concerned with the state of the "system" before and after a transaction.

This sentence These modifications are atomic in the sense that the application state is supposed to be consistent and valid after the operation execution describes consistency, not atomicity.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Atomicity also means that a bunch of changes happen at once, it can't happen partially and thus it keeps the application state consistent afterwards. I don't understand your point tbh. I think I used it correctly. The sentence describes both. There is a way of doing non-atomic changes but then the app state is not going to be consistent after each change.

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
rule do |context:|
params_key = :"#{name}_id"

next key.failure(:key?) unless key?(params_key) && context[context_key]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having some difficulty understanding this line. How exactly is next going to work in this context?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
Copy link
Contributor

@Kefa7y Kefa7y left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nicely done!

Copy link
Contributor

@ston1x ston1x left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing! Thank you for doing this :)

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
2. Check policies
3. Check preconditions
4. Validate user input
5. Call operation if everything is valid
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about callbacks ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Callbacks are irrelevant in this case and will just confuse.

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
Copy link
Contributor

@radekzawada radekzawada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just small comments

pyromaniac and others added 2 commits February 24, 2023 21:37
Co-authored-by: radekzawada <radek_zawada@op.pl>
Co-authored-by: Mohamed Ashraf <mohamed.ash.roshdy@outlook.com>
Co-authored-by: Nicolai Stoianov <stoianovnk@gmail.com>
@pyromaniac pyromaniac merged commit b5a5301 into main Mar 6, 2023
@pyromaniac pyromaniac deleted the framework-docs branch March 6, 2023 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants