15,897,518 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by fastal (Top 3 by date)
fastal
2-Jun-22 14:36pm
View
Ha this is like hit #3 on Google and all the wiseacres answering tell me to Google it - it's hilarious here that there's somebody smarter than those who bother to make that comment and that's the OP (also more polite than all of us)! If you're too lazy to post a link at minimum (lmgtfy links don't count), at least have the courtesy to keep your mouth shut.
fastal
4-Feb-18 22:29pm
View
I think you are on a track that would work.
I would think if you are still going to use repositories, do the mapping between the EF objects and YOUR objects INSIDE the repositories. Here is a great post that goes into more detail about doing it that way:
https://stackoverflow.com/questions/24588838/entities-vs-domain-models-vs-view-models
I refer to the same things when I say 'domain objects' and 'business objects' - but not all writers do that, I see. In that post, it appears as though they may mean the EF objects by 'domain' objects - although I'm not sure, that seems a non-standard way of doing it. Sorry for using both of the terms.
You will see most people don't talk about the 'DDD-Services' layer for composing and integrating your business objects. This example is no exception. Just make room for it in your project - it is not a layer that all properties need to be mapped to nor 'thru' - when you have some complicated inter-object logic, though, it may make more sense to make a new object in the services layer, inject the business objects that need the work done, and do the work there, to avoid mixing references to objects. Note - this is about 10% of the logic that really needs it, but, usually it's the more complicated logic ;-)
If your business objects don't hold references to repositories, it makes unit tests easier, there is less to mock... I would not recommend mocking nor abstracting your business objects either to test your domain layer objects - this will result in less granular units as they depend on the business objects, but if your business objects have good tests, that will mitigate this. This will give you most of the value of the tests without the technical debt of abstracting your business objects (which takes more than it gives). If this last paragraph doesn't make sense, ignore it ;-)
fastal
25-Jan-12 11:47am
View
Deleted
thanks, I have used that when I needed to mix. However this came in very handy when I wanted to have an app which was usually interactive, but, I wanted to access the console when run from a batch mode and not be interactive. This meant that I didn't want it to start a console in the background most of the time, only when there was a command line. Whereas a console app always displays one by default (not what I wanted) and you'd have to quick hide it. thanks.