this is very useful and in-detail presentation. Thumbs up. If we were to include Web Services for external systems to use (e.g. Create Product from outside system), what project will these services reside in? Infrastructure - I guess?
@abcdef.fedcba6 жыл бұрын
50:00: This is quite easily possible. I use to do this by implementing a base validator using AbstractValidator where T: SomeType That way u can write some other validator deriving from your abstract base validator and only have to invoke .base() at the constructor of your derivate.
@BenHayat6 жыл бұрын
So Jason, each inner circle is like a father to the outer layer/circle? The Domain is the grandfather that outlines (Interface contract) for his children to implement (Application layer) and App layer outlines (interface) the features that his children (Persistence, Infrastructure, presentation) will implement and that's why the dependency is revered backward towards the core as far as "Logic" dependency requirement goes, but the actual implementations are done by children. Like in military, the generals (Domain) design a war plan but the soldiers (App and outer layer) execute (implement) those plans. Is that my correct understanding?
@JasonTaylorDev6 жыл бұрын
Yes, I like your analogy! Take a look here for more details - docs.microsoft.com/en-us/dotnet/standard/modern-web-apps-azure-architecture/architectural-principles#dependency-inversion.
@sebastianbusek20875 жыл бұрын
In general, yes. But the domain contains only domain related stuff, the interfaces sit in the Application layer. Interfaces aren't domain related, they are application related. Application layer just defines interfaces, but the implementations are on edges, like the implementation of NotificationService which sits in the Infrastructure layer.
@suminda-b6 жыл бұрын
great talk Jason, you have explained it really well.
@anarhistul72575 жыл бұрын
Can you tell me more about Interfaces vs Infrastructure folders in Application? It seems to me the interfaces from Interfaces could belong in Infrastructure .
@Dtripathiuk6 жыл бұрын
As in the Domain layer product , supplier . etc are tightly coupled with single domain service . What if the supplier or the product (business plan to change their model and stop selling x and introduce selling y) . Q - 1) do we need to build the entire domain service again as the supplier is changed ? , 2 ) what if the product is made redundant and new product is introduced ? . Should we not create a seperate service and implement the single responsibility with the interface , as the other domain service just need to access the interface rather then worried about compliing it and redeploying the entire system ?
@JakeAndDaddy6 жыл бұрын
Can’t have been a C64 if it only had 20kb of memory. There were around 39000 bytes available with BASIC loaded
@sknty5 жыл бұрын
Good stuff, thanks mate!
@piresashwin6 жыл бұрын
Really good video. I have a question. 1. Isn't there too much of duplication of the entity? for e.g. the properties of customer entity are almost duplicated across request and model? 2. Also the request validator should be written against the CreateCustomerModel or the CreateCustomerRequest ? Thanks
@sebastianbusek20875 жыл бұрын
1. Yes, but those "entity" classes serves for the different layer of the application 2. The code was updated, but the CreateCustomerModel served only as the DTO used in the command. In general, you need to verify if the command doesn't lead to incorrect application state.
@jackcarloslatin77275 жыл бұрын
Thank you excellent video
@ozkanb5 жыл бұрын
At 23:00 isn't using ConfigureAwait(false) a best practice? And another question: in which layer would you put caching logic?
@gobistaff225 жыл бұрын
He did state that a good place for caching is the unit of work layer. Just derive new classes from your unit of work implementations and put you caching logic on top of those.
@runxixiao73996 жыл бұрын
Great,Thanks for sharing.
@patrickmashaba72546 жыл бұрын
Is there any recommendation for learning resources for this particular Architecture?
@kastriottii6 жыл бұрын
yes see 1:31:07
@srinivasadineshparupalli51396 жыл бұрын
Hey Jason, Is it possible to share the PPT? I was looking at the GITHUB and was not able to find it over there.
you state that no layers depend on infrastructure, however, looking at the code from github, the Presentation layer does depend on Infrastructure. I just want to verify. I am an old newbie (over 50 new to .net) and I have been trying to find a concise organized pattern to follow for my applications and I am excited to find your site. It is logical, organized and I understand more of it that not. Thanks for your time and explanation. Is it that no inner layers depend on infrastructure? Just trying to understand...
@sebastianbusek20875 жыл бұрын
Infrastructure layer, as well as the presentation layer, contain the only implementation of interfaces defined in the Application layer. The project dependency is needed thru absence of composition root in other layers of the application. Does it make a sense?
@frankbanini88846 жыл бұрын
My question is how do you use Asp Core Identity with this architecture
@nicolacassolato65765 жыл бұрын
I use a similar architecture in my projects, identity is kinda difficult because it’s difficult to abstract I create a project like the persistency one with all the things related to identity, and an interface for the current user which is populated by the presentation layer
@stevenoderayi57766 жыл бұрын
Awesome! Thanks
@shakti53856 жыл бұрын
Sir Do you have Example for Database first?
@JasonTaylorDev6 жыл бұрын
Hi again Shakti. For the benefit of others here, as per our conversation please take a look at www.codingflow.net/create-northwind-traders-code-first-with-entity-framework-core-part-1/ and www.codingflow.net/create-northwind-traders-code-first-with-entity-framework-core-part-2/. Thanks for the question.
@feelingeverfine6 жыл бұрын
So you just did database first, then scaffolded and now you call that code first??
@JasonTaylorDev6 жыл бұрын
The terms can be confusing. Earlier version of Entity Framework included two approaches model first or code first. You could use either approach with an existing database or to create a new database. So generally speaking for an existing database you could use model first or code first. With Entity Framework Core we no longer have the model first approach, just code first. So, if you have an existing database and you reverse engineer it to code first, this could be considered a database first approach. But after that it's code first all the way. You can read more here - msdn.microsoft.com/library/ms178359.aspx#dbfmfcf.
@williamdavies19776 жыл бұрын
This was helpful to me. Start with a new solution and experiment with the various options. docs.microsoft.com/en-us/ef/core/get-started/aspnetcore/existing-db
@shakti53856 жыл бұрын
Yes that I review earlier but I am now trying to make a sample where we can have single table projects with database first and EF Core and Entity and DBContaxt is separate
@jackxlifer63466 жыл бұрын
How Identity auth can be added to this architecture? For example IdentityDbContext use specific classes such as IdentityUser, etc, should they be inside Application or Persistence layer?
@sebastianbusek20875 жыл бұрын
IdentityDbContext should be part of the Persistence layer, it defines only how data are stored. However, if you're planning to define your custom RBAC (role-based access control) interfaces are part of the Application layer and the implementation will be in Infrastructure layer.
@johnnysc95076 жыл бұрын
Is the source for this presentation available for download? BTW, great video!
@JasonTaylorDev6 жыл бұрын
Thanks John - you can find the code here; github.com/JasonGT/NorthwindTraders.
@johnnysc95076 жыл бұрын
Awesome! Thanks for the quick reply!
@tedaiduong905 жыл бұрын
Anyone can share me some code sample?
@Amrfayz4 жыл бұрын
That's a Tester Laugh 1:29:00
@Rejy116 жыл бұрын
Is this solution RESTFUL? On inspecting the code it doesn't seem like it is?