Timeline for How to get ORM (Ef Core) Entities follow a DDD style . Which is the best approach?
Current License: CC BY-SA 4.0
11 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Mar 19, 2019 at 15:10 | comment | added | Engineert | +1 for your Fluent API suggestion. It is what I mean to @Badulake by comment. | |
| Mar 18, 2019 at 12:52 | comment | added | Robert Harvey | @Flater: [shrug] The designer was never necessary to develop "Model First." | |
| Mar 18, 2019 at 12:49 | comment | added | Flater | @RobertHarvey: Which still renders my answer ("EF has two approaches") as correct, as the Model First approach is an approach you take outside of what EF provides. | |
| Mar 18, 2019 at 12:48 | comment | added | Robert Harvey | @Flater: You can still develop Model First. EF just doesn't have an edmx or the visual designer anymore. | |
| Mar 18, 2019 at 12:07 | comment | added | Flater | @Engineert: I always liked Model First (because I've been taught UML and that's how I approach new projects), but as far as I'm aware Model First has been deprecated in favor of Code First. Here is a 5 year old article that suggests the same. Note that what the article calls EF7 has ended up being renamed and released as EF Core. | |
| Mar 18, 2019 at 12:02 | comment | added | Engineert | You are wrong about EF approaches. There is Model First approach also. | |
| Mar 18, 2019 at 10:58 | comment | added | Flater | @Badulake: Because you will garner a lot of friction from developers who blindly apply the "everything must be abstracted" approach. I fully agree that (uow+repositories) is just a replication of (context+dbsets). I have written a more in depth answer where I advocate not using them and simply using the context directly. I stand by that notion, but many developers protest at the suggestion of doing so because they consider it a leaky abstraction. | |
| Mar 18, 2019 at 10:54 | comment | added | X.Otano | I think it is a common decission to choose, inside your application services layer, between consume custom Repo/UoW or delegate that work to DbContext. That will choose between A or B. If you choose to use both I think you will end with a overdesigned DbCOntext with little advantages, so yes i would say that they are exlusive.Why would you use repos/UoW , and, at the same time, a DbContext? Also I want to know what DDD purists will do in our situation, this is the place to see other options.Thanks by your colaboration | |
| Mar 18, 2019 at 10:49 | comment | added | Flater | @Badulake: Yes, but A/B are not necessarily mutually exclusive. I work with what I would call a "DDD light" approach (purists will probably take heavy offense to me calling what I do DDD but I do at least try to follow the spirit of DDD's guidelines), where I use Code First and repositories/unit of work. Based on the options you list and their pros and cons, I think you grasp the technical elements but aren't seeing every possible way in which to utilize them. I don't quite understand your B con; because wouldn't that apply in all cases of using an EF context, including A? | |
| Mar 18, 2019 at 10:40 | comment | added | X.Otano | I see your point. this is what I have actually done in my last project. I think this solution will be part of option B , dont you think so? My question is about anothers ways to handle that problem. I will use your anwer to enrich/explain better the question /option B. Many thanks | |
| Mar 18, 2019 at 10:36 | history | answered | Flater | CC BY-SA 4.0 |