I have problem in create generic domain service or not?? I have "BaseEntity" that inherit any entity from it and has been every moment set value when update or insert method called in repository .my domain service layer that implements every entity business. my problem is what I have to do when I have one business that implement in every Services in domain service.can I use generic class and interface to manage BaseEntity and then change business for example for Update method override base update method or I used for every entity one service class with one interface with separate business???
can I use generic services in domain service with different business or not?
250 Views Asked by morteza rezaei At
1
There are 1 best solutions below
Related Questions in C#
- How to call a C language function from x86 assembly code?
- What does: "char *argv[]" mean?
- User input sanitization program, which takes a specific amount of arguments and passes the execution to a bash script
- How to crop a BMP image in half using C
- How can I get the difference in minutes between two dates and hours?
- Why will this code compile although it defines two variables with the same name?
- Compiling eBPF program in Docker fails due to missing '__u64' type
- Why can't I use the file pointer after the first read attempt fails?
- #include Header files in C with definition too
- OpenCV2 on CLion
- What is causing the store latency in this program?
- How to refer to the filepath of test data in test sourcecode?
- 9 Digit Addresses in Hexadecimal System in MacOS
- My server TCP doesn't receive messages from the client in C
- Printing the characters obtained from the array s using printf?
Related Questions in DESIGN-PATTERNS
- Will it slow down the performance when Unit of work pattern is used with EF Core
- Design patterns - How Design patterns work with bulk data
- Using Repository pattern to fetch data from different places and build list of objects
- Suggest best design patterns to update or insert bulk data
- Mapping one collection of objects into another collection of objects
- How can I break down a large presenter in the Viper design pattern into smaller pieces?
- How to create under the label in Textformfield, not a border, in Flutter
- Own Pattern / framework for interfacing with components in C
- Common Method Implementation for Elasticsearch and OpenSearch Java SDK
- How can I decouple them?
- Understanding Potential Deadlock in Resource Pool Implementation Described in "Go in Action"
- Dependency Injection Patterns stand alone implementaion
- How to use GoF design pattern for software robustness?
- Pipeline data processing and code architecture
- Mocking inherited class where new object is created or how to unsmell my class
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 DOMAINSERVICES
- AWS Directory Service, can't assign "Domain Admins" to Admin user to correct permissions issues
- Get distingushed name of the AD Logged user from the local computer?
- Usage of domain services as data provider to entities and value objects
- Setting a User Group with an Array using Active Directory Domain Services VB.net
- DomainOperationException in Silverlight Project with RIA Services
- DDD: The problem with domain services that need to fetch data as part of their business rules
- How do you mount Azure Files using AD credentials?
- DDD - domain service to store entity in not primary infrastructure
- Azure AD DS and Roaming Profiles
- Can domain event be raised in domain service?
- Can a domain service inject multiple repositories or operate with different aggregate roots?
- How to manage Domain TXT record. What are limitations
- Verify the entity properties at run time from a dictionary of conditions in c#
- Is it possible to (how) to lock a domain server behind a password?
- Connect Azure VM and On Prem Server to Azure Active Directory Domain Services
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?
For the most part I would advise against any generic base classes for your domain. If you have a hierarchy of classes it may be that you have a more technical/framework domain but even there you should favour composition over inheritance.
I would not, for instance, use a
BaseEntityas I find it superfluous. The closes you could come is perhaps something like anIRepository<T>with aT Get(Guid id)and avoid Save(T instance)method but you would have to think exactly where you would use something like this. You could make your roles explicit by following the single responsibility principle and go withIRepositoryGetandIRepositorySave. However, these type of interfaces are only useful where you have some broad commonality between the objects and that typically doesn't happen. You may find that some lookup data seems to fit into this space but even there you may rather want to design a common repository as opposed to individual repositories for each type.What you most definitely want to avoid is to have a coarse-grained interface and then have various
NotImplementedExceptions thrown. When you find that you are doing that rather split the interfaces into more fine-grained versions and implement only the desired interfaces. In this way you can use safe casting to ensure that the interface is implemented before making a call to the method.