domain driven design - DDD and avoiding CRUD -


it seems on articles read, crud avoided in ddd dealing modeling business process , not data. however, find hard see not have crud operations on entities. example, in school grading system, before teachers can grade students, schoolyear has present or perhaps gradingperiod. can't see how can manage gradingperiods without crud. enlighten me on this?

a important part of ddd bounded contexts.

a bounded context delimited part of application terminology consistent. ddd seldom correct approach entire application. therefor divide application in separate bounded contexts. within each bounded context can have different pattern. crud bc has little domain complexity , ddd area high complexity.

crud not avoided per sé. crud avoided when there complex business rules in play. ddd avoided when you're providing forms on data little rules.

so, possible have application parts doing simple crud , other parts richer domain model.

that's 1 part of equation, original question:

"before teachers can grade students, schoolyear has present or perhaps gradingperiod"

you imply here creating schoolyear crud operation, you're thinking "insert schoolyears ...". possibility (and way using bounded contexts, see above). using crud part ok, if there's not lot of domain logic going on.

however, need determine whether "inserting new schoolyear" not technical jargon "opening schoolyear". ddd emphasizes language. if determine opening new schoolyear has lot of rules attached , requires complex code, should put inside domain. lso if domain experts keep telling how "open new schoolyear", should model behavior in domain. instead of calling "insertnewschoolyear", should call method "opennewschoolyear". whether insert in db irrelevant, want capture specific domain knowledge in model.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -