Comments (4)
Hmm, not exactly sure what it means, could you elaborate? What are business rules?
When I look at this https://github.com/MarimerLLC/csla/tree/main/Samples/CslaFastStart#adding-business-rules, I see some sort of constraints (like "required"). As CSLA doesn't really promote having a proper model, everything is about "DTOs" (I hate this name). If you have a model, you have value objects to encapsulate rules for the values and aggregates where you guard the invariants.
It's probably a good idea to improve the error handling, as now it's almost exclusively done by throwing exceptions. It is possible to produce error events, but you don't always want them to be persisted. Having an attribute for events that need to be ignored for persistence is something I thought about.
When it comes to contracts, there are good tools like FluentValidations to do it.
My answer here seems to be chaotic, I am trying to explain how I would implement the domain rules and clearly separate them from "the edge" rules (before handling the command). What I can say for sure is that CSLA examples show something that I would never do.
So, my question would be what exactly are we looking at? Any conceptual idea, pseudo-code example you have in mind?
from eventuous.
What I am looking for is a way to define a model and validation for the respected fields. For example, email address or postal code. Or an integer field that cannot be negative. Being able to define this in the model provides contracts that a UI developer can base validation on before he attempts to send to the API. I am familiar with FluentValidation, but that is generally done on the server side.
Here is the idea that I am trying to achieve. https://scalapb.github.io/docs/validation
from eventuous.
The link you posted points to proto file annotations for validations. Similarly, you can build a Web API with contracts annotated with [Required]
etc attributes. I believe there are plenty of methods to convey those annotations to the UI using the OpenAPI spec handling, the server would ensure that the values received are correct, etc. It's all happening before anything in Eventuous is engaged, so it's not the concern of this library.
The only place where Eventuous might step over to that world is the new generated command API, but I'd still consider it "experimental".
To conclude, there are tools to make it work. You are looking at the contract level, and Eventuous is about the domain model and things around it. Essentially, its work starts in the application service, where you convert primitive types from the command to value object. Value objects would ensure that things like email and postal code are correct. It's not validation per se, it's part of the model, and it cannot be expressed in a generic way because each model is different.
from eventuous.
Agreed. You have done a fantastic job on Eventuous. As I am transitioning my career I am looking to get more involved in contributing to open source projects. I have great interest in contributing to yours.
from eventuous.
Related Issues (20)
- [EVE-34] Process managers HOT 2
- Links to edit markdown in GitHub's documentation are broken due to language code in path HOT 1
- Feature: The ability to fold historical events into one another (to keep the Event Store size managable) HOT 1
- [EVE-33] Race condition in ESDB subscriptions with random NullReferenceException HOT 10
- Eventuous breaks with npgsql >= 7.0.0
- [EVE-38] Subscriptions pool HOT 1
- [EVE-36] Bug: mapped commands expose the wrong contract to OpenAPI
- [EVE-39] Expose endpoint configuration for command mapping
- [EVE-43] Test issue
- [EVE-44] Support authorisation through attributes (HTTP)
- Avoid unnecessary copy of Payload and Metadata in EsdbEventStore
- Most of the AspNetCore extensions should likely be changed/moved to something more generic HOT 1
- Multitenant implementation HOT 20
- Custom queue name in RMQ gateway subscription
- Crypto Shredding Serialization/Deserialization Support
- Subscriptions sometimes skips events HOT 24
- Postgres subscription is flooding database server with polling queries HOT 3
- Postgres subscription does not automatically reconnect after database server restart HOT 1
- Promote InMemoryEventStore to the main Eventuous library
- Wrong event stream name in EventStoreDB persistent subscription events
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eventuous.