Assuming everyone has the rights to do the CRUD operations (everyone is an admin type user). I have displayed CRUD operations the user can perform in the Domain diagram however, it's become quite messy. I am curious if it's acceptable to do the alternative approach shown in the images below instead since the multiplicative relationships remain the same for each action (create,edit,delete)
Domain model defining relationships
415 Views Asked by Krellex At
2
There are 2 best solutions below
0
Gerd Wagner
On
The main issue with both of your class models is a confusion between the type/instance levels. Your "can create/edit/delete" authorization relationships do not hold between a specific user and a specific object (an instance of Company, Project or Ticket), but rather between a specific user and a sepcific object type (Company, Project or Ticket), so it's not an ordinary association between two ordinary object types.
If you want to describe/define such authorization relationships with a class model, you would need to define a meta-class like ObjectType and express that your object types (Company, Project or Ticket) are instances of it.
Related Questions in UML
- steps to create a web app with backend and database and web
- How to present this example concept in UML: Using 2 LCD displays in C/C++
- In the UML diagram, in the Class diagram, what does stereotype mean <<compound>>?
- UML representation of containerized services
- uml class diagram for boxing match
- Polymorphism can be described as:
- Why am I getting a plantUML syntax error with a statechart in a package?
- System or external system as an actor in a use case?
- How to model statechart behavior inheritance using UML?
- Can we have an interface create objects of another interface in UML Class Diagrams?
- Is my relationships correct in my class diagram
- How to attach a Port shape to a class shape?
- How to correctly create a sequence diagram?
- How can I insert activity diagram image to an use case in Enterprise architect?
- Use case extends or include
Related Questions in DOMAIN-DRIVEN-DESIGN
- How to use Interfaces in Domain Modelling DDD
- Domain driven design CQRS with multiple aggregates and bounded context
- Need more parameters in subclass overridden method
- Domain Driven Design: Aggregates Creating Aggregates
- How to deal with objects creation per request with high RPM node applications
- Async integration events needed sync
- In DDD where to handle interaction with external services that is part of business logic? In Domain Model or in Command Handler?
- How to split large time-related aggregates in DDD?
- One column with foreign key to multiple tables inf EntityFramework Core
- DDD & Clean Architecture: Why not define repositories in the application layer?
- Domain driven design: How to add a new database entry for an Aggregate?
- Integrate a versioning in aggregate
- when to pass args to the constructor of a service in ts?
- ASP.NET boilerplate module's dbcontext recreate abp main tables
- What's wrong with multiple entities in multiple bounded contexts pointing to the same identity?
Related Questions in CRUD
- On the server side, it returns undefined but on the client side, logs the values no problem
- Query parameter works fine with fastapi application when tested locally but not working when the FastAPI application is deployed on AWS lambda
- How to perform CRUD operations on a static JSON array in Angular? (without API)
- Inertia & React CRUD without reloading page
- How do I make sure that a user has the right to delete something when making a delete route
- MudBlazor TextChanged Data Conversion
- I cannot delete a user
- "Cannot be resolved as a type" problem with Java
- Observable in Angular
- How do I get this data from server.js file to +page.svelte file?
- Laravel 9, Undefined variable $users
- How to handle concurrency issues in ASP.NET Core with Entity Framework Core when updating entities in a service?
- Laravel Crud Operations and Json Handling
- I can create course but can't update it. (Express, React)
- include_all_form_fields parameter for subfields in laravel backpack
Related Questions in DOMAIN-MODEL
- How to map DTO properties to those in a domain object when there is a class hierarchy in C#
- Migrating from a database centered application to DDD based application
- Eclipse not showing 'Domainmodel Content-Type' in Preferences
- The Problems List is not Populated successfully in the Get Level API
- Custom Validation for Generic Types in c#
- Domain entity relations loading and performance issue
- How to model dependencies in chained through time pattern?
- How to model "old" and "new" list of things in Java to avoid accidental use of one or the other?
- How to define domain entity model in frontend and backend?
- How to let user change his address without affecting the same one in the order?
- UML class Diagram: Keep history of instance of class
- How to lower redundancy in my UML Class diagram?
- In Event Sourcing, How to make changes in database using arrays and no ORM?
- Robustness diagram and design class diagram
- What to do for objects that are equal but not identical?
Related Questions in DOMAIN-MODELLING
- Timefold: Employee scheduling with variable number of employees per shift?
- How to lower redundancy in my UML Class diagram?
- Domain model defining relationships
- Domain Model modelling how complex should the diagram be/become?
- How to model an entity with a currency?
- how to represent enums in DDD Aggregrate modeling
- Typescript: define types without a field
- How should I use singleton in DDD?
- Domain construction Haskell
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?


In short
If it becomes messy, it probably lacks of separation of concerns, or represents associations that are not really needed.
More explanations
Are the associations needed?
An association between
UserandXxximplies a semantic relationship between the two classes. This means that instances of the classes are linked and not just for the time of an operations. Soxwould be able to find theUser(s) that updated it, anduwould know theXxxinstances that it updated. This kind of association can make sense if you want some audit trails, but this seems not to be your purpose here.In other words, the fact that a
Usermay perform some operations that CRUD instances ofXxxis not sufficient for justifying an association.If they are needed, do they represent what you think?
Now it appears that your associations are
can ..., i.e. some kind of authorisation scheme. Your diagram tells that each user would need to know in advance all theXxxthat it could update. This is a heavy burden. It would also imply that a user needs to know all theXxxit can create; before they are even created? This looks somewhat inconsistent.Modeling an authorisation scheme
If you'd wand to design an authorisation system, you'd probably not link users directly to the object, but use some intermediary mechanisms:
Separation of concerns
And to keep things continue to be messy, you should consider: