I understand the dependency inversion in depth today. I loved the way, you explained with practical examples.
@RahulNath24 күн бұрын
So happy to know that Kumar! Do check the ASP Series for more videos bit.ly/asp-net-core-series
@bodek3212 жыл бұрын
Rahul, I’m deeply impressed with your presentation and couching skills. 👏 Amazing job! I never before saw so simplified and practical introduction to the onion architecture and the DIP principle. Thank you for your effort. 100% I will use it to coach junior engineers
@RahulNath2 жыл бұрын
Thanks a ton Bogdan for your kind words! Happy they are helpful. I have one more video in this series here kzfaq.info/sun/PL59L9XrzUa-nuI1jIibFnJpVPZ0vYXyeq (You've already seen the one on testing)
@nasmob56562 жыл бұрын
Sir pleaaaaase dont stop giving us your priceless knowledge , hands down the best architect and developer on youtube the way you made the traditional layered architicture a onion architicture is never explained like this on youtube or even payed courses
@RahulNath2 жыл бұрын
So nice of you and thank you for the wonderful comment! Do check out the full series here bit.ly/asp-net-core-series
@nasmob56562 жыл бұрын
@@RahulNath love it ima watch them all
@RahulNath2 жыл бұрын
@@nasmob5656 Do reach out if you have topic suggestion or feedback!
@zdxzxzdxzx67802 жыл бұрын
The best explanation on DI I've seen so far. Thanks.
@RahulNath2 жыл бұрын
Glad it was helpful!
@franciscogilt2 жыл бұрын
Excellent explanation Rahul!
@RahulNath2 жыл бұрын
Thank you Francisco! Do check out the full series here bit.ly/asp-net-core-series . I'm sure you will like it too 🙂
@barwalgayatri46552 жыл бұрын
Great u have Explained Dependency Inversion with such a reat example . Thanks a lot.
@RahulNath2 жыл бұрын
Glad you liked it!
@rubeushagrid41313 жыл бұрын
Good start and you have a very nice voice. No show off and utmost clarity is what that brings me here.
@RahulNath3 жыл бұрын
Thank you and happy to know you are liking it. Do check out the full series here kzfaq.info/sun/PL59L9XrzUa-nqfCHIKazYMFRKapPNI4sP And let me know in case you have topic suggestions.
@itsmevaibhav007 Жыл бұрын
You are just awesome 🤩
@RahulNath Жыл бұрын
Thank you so much Vaibhav 😀Hope you are liking the full series bit.ly/asp-net-core-series
@himanshugarg4942 жыл бұрын
you are best
@RahulNath2 жыл бұрын
Happy it helped Himanshu!
@gouthamk3783 жыл бұрын
Thanks again Rahul! Keep up the good work! 👌
@RahulNath3 жыл бұрын
Thank you Goutham, sure will!
@alwaseem5309 Жыл бұрын
Extraordinarily...
@RahulNath Жыл бұрын
Thank you - Hope you are liking the series bit.ly/asp-net-core-series
@alwaseem5309 Жыл бұрын
@@RahulNath liked every single video. 👍
@ShahabLodhi2 жыл бұрын
Loved it thanks Rahul. Big fan
@RahulNath2 жыл бұрын
Thank you Shahab!! Hope you are enjoying the full series bit.ly/asp-net-core-series
@ShahabLodhi2 жыл бұрын
Sure bro thanks for the share❤️
@investmentjourney79123 жыл бұрын
Amazing video looking forward to part 2 on layering on clean/onion architecture.
@RahulNath3 жыл бұрын
Great you like it. Do check out this video where I go through a refactoring exercise talking more about CQS pattern kzfaq.info/get/bejne/jqthqphj1bS9omw.html Do let know if there are specific topics like this you would like to hear about.
@rohan4rich3 жыл бұрын
Beautifully explained
@RahulNath3 жыл бұрын
Thank you Rohan! Happy you are liking it. Hope you will like the other videos in my ASP NET Core Series too. Do let know in case you need any specific areas covered.
@ksdvishnukumar3 жыл бұрын
Very well Explained in a simple way and up to the point. Just one suggestion is still we can break down the BLL. All the domain models(entities) and interfaces can move it to separate project so that BLLonly focus on core business services.
@RahulNath3 жыл бұрын
Glad you like it. Regarding separating out the entities and interfaces into separate projects, is there any particular reason that you prefer splitting them into different libraries? I prefer to keep them together. Couple of reasons for that - It allows to be more explicit about the interface ownership. If in a common library, it's hard to tell who owns what. - Prevents accidental leaking of abstractions.
@ksdvishnukumar3 жыл бұрын
@@RahulNath Thanks Rahul.. it makes sense the reason what you gave...
@volodyakachalka5187 Жыл бұрын
Awesome :)
@RahulNath Жыл бұрын
Thank you 😀Hope you are enjoying the full series bit.ly/asp-net-core-series
@volodyakachalka5187 Жыл бұрын
@@RahulNath yeah im going with sequence :)
@dailytech37853 жыл бұрын
Rahul, Again...clear, precise and outstanding.
@RahulNath3 жыл бұрын
glad you like it , Thank you 😀
@ganeshkumar-zz5hp2 жыл бұрын
Great Content for Dotnet core Rahul. you work is awesome.. Hatsoff of your hardwork and spending your own time to teach us various skills. keep up your good work which will help internet community to learn many things like one click with your videos... thanks again...
@RahulNath2 жыл бұрын
Thanks a ton Ganesh! Glad to hear it's helping and do let know if you have any topic suggestions.!
@UPSCCSE-ku7ej3 жыл бұрын
Awesome work
@RahulNath3 жыл бұрын
Thanks again!
@profajaysharma3 жыл бұрын
first time I understand the idea of onion or clean architecture. Thanks.
@RahulNath3 жыл бұрын
That's awesome. Thanks Ajay!
@PradeepKumar-be4co3 жыл бұрын
Nice explanation Rahul. Finally I understood difference between Dependency Injection and Inversion..:)
@RahulNath3 жыл бұрын
Thank you Pradeep and happy that you found it useful!
@adriano.digiere3 жыл бұрын
Thanks Rahul! It helped me a lot to understand some principles of onion architecture. Greetings from Brazil.
@RahulNath3 жыл бұрын
Thank you Adriano. Happy you liked it. Do check out my ASP NET Core Series if that is of interest to you - kzfaq.info/sun/PL59L9XrzUa-nqfCHIKazYMFRKapPNI4sP
@kumar_codes3 жыл бұрын
Awesome content with best explanation..keep it up bro... really appreciate your work
@RahulNath3 жыл бұрын
Thank you Pritish, Glad you liked it!
@pramodaaskar2933 жыл бұрын
Great Video and the content Rahul !! Keep it up!!
@RahulNath3 жыл бұрын
Thank you Pramod!
@Blr0463 жыл бұрын
You have great knowledge, very nice voice and teaching skills.. All in one place. Thank you so much.. I am way behind to these concepts, will follow you..
@RahulNath3 жыл бұрын
So nice of you and glad to hear that. You will like my ASP NET Series here kzfaq.info/sun/PL59L9XrzUa-nqfCHIKazYMFRKapPNI4sP Do let me know if there are specific areas you are looking to be covered.
@Blr0462 жыл бұрын
@@RahulNath What is your advice, If I want to consume the weather data from both web application and mobile application. Should we avoid physical dependency (referring of "BLL" project in "Web" project)
@RahulNath2 жыл бұрын
@@Blr046 Is this a traditional MVC app or SPA? If you don’t find any specific need to host the API and Web app separately I would start out in the same. If the need arises you can always split it out . If hosted separate API how do you plan to access it? Are you going to proxy all calls over to API from the Web app server? I would avoid that if all it’s doing is proxying. Let me know if you have additional questions
@Blr0462 жыл бұрын
@@RahulNath I have created a asp.net core with react.js application using visual studio 2022. The same application going to be used by web and mobile app by the same user. I am not sure about proxying and all. I want to re use the backend logic for both web and mobile by having common implementation. One basic stupid question, sorry.. can we have LAYERING which can work for both MVC app and SPA or with the minor changes. Even, Why should my business logic be tied to the type of hosting environment? Can we design such that it can work for azure functions/aws lamda as well or with the minimum changes. I am not sure which one works fine for me azure functions or aws lamda at the movement. I don't want to be in a situation to re design the entire application at the deployment. I am not able to put the things together.
@akfsf005433 жыл бұрын
Mr. Rahul your video is very good and explain very well. please include model binding and entity framework core also in next video for LAYERING. which is help to real projects working.
@RahulNath3 жыл бұрын
Thanks Anupam, glad you liked it . Sure will do one video on integrating with EF. Between check out my video here on model binding kzfaq.info/get/bejne/mN6bptNmnJvUm2w.html
@scottatkinson63393 жыл бұрын
Awesome video! Be really good to see a video utilizing the Key Vault service within a .Net Core Application, storing connection strings etc
@RahulNath3 жыл бұрын
Thanks Scott and glad you liked it. I have a video on Key Vault here kzfaq.info/get/bejne/bNKPntOqzLWUeZc.html and a few more in this playlist kzfaq.info/sun/PL59L9XrzUa-nEwFPxQRu8jV94uM00pN0i You can also check out how you can connect to SQL without using a Connection String if that interests you - kzfaq.info/get/bejne/fKxylNpe2s2WXX0.html Let know if that helps you.
@scottatkinson63393 жыл бұрын
@@RahulNath Amazing, thanks.
@RahulNath3 жыл бұрын
@@scottatkinson6339 Awesome , glad it helps 👍
@ralphquincy61513 жыл бұрын
sorry to be offtopic but does any of you know a trick to get back into an Instagram account?? I was dumb forgot my login password. I love any tricks you can offer me!
@harryjohan47463 жыл бұрын
@Ralph Quincy Instablaster ;)
@anshulagrawaljbp3 жыл бұрын
Nice Work Rahul !!! Can you please make a video on CQRS Patterns?
@RahulNath3 жыл бұрын
Thank you Anshul and glad you like it. Yes I have something planned soon on that. I had written about a scenario in there too www.rahulpnath.com/blog/avoid-commands-calling-commands/. Stay tuned and thank you for the feedback.
@shrimohan12 жыл бұрын
Rahul pls create a video on encapsulation and abstraction. Pls pls pls
@RahulNath2 жыл бұрын
Thank you for the suggestion. I will try and cover some of these concepts. Here is one that is a bit close to it www.rahulpnath.com/blog/constructor-and-constraints/ Also do check out the other videos in the Clean Code series here kzfaq.info/sun/PL59L9XrzUa-nuI1jIibFnJpVPZ0vYXyeq
@diwaspoudel73 жыл бұрын
Thanks for the video. If you have a time, please makes a video related to gRPC and microservices. It will be very much helpful
@RahulNath3 жыл бұрын
Glad you liked it. Will add it to my list of videos.
@TellaTrix3 жыл бұрын
DAL is still referring in web to resolve the dependency.
@RahulNath3 жыл бұрын
Yes that is correct it is for the DI. In this case the Web Project also acts as the Composition Root, where the whole application is composed. I talked about this in a related video here kzfaq.info/get/bejne/jqthqphj1bS9omw.html. Let me know if that clarifies your question or if you have additional questions.
@mrityunjaykumarsingh24953 жыл бұрын
Grate !!
@RahulNath3 жыл бұрын
Thank you!
@abhaypatil76533 жыл бұрын
Nice && Informatiive video...Is it any disadvantages of this architecture?.
@RahulNath3 жыл бұрын
Not particularly useful if you don't have any Domain logic and it's a simple CRUD. But otherwise have found this pattern maintainable and useful.
@aaqibkhan83602 жыл бұрын
Hi Rahul, Thank you for this wonderful explanation! I do have a question over dependency inversion. Since the DAL Layer is now referencing the BLL layer, you have BLL layer models in your DAL project (21:17 WeatherForecast return type of Get() in DummyWeatherDataRepository). Doesn't this violate the ultimate purpose of achieving encapsulation , as any change in properties of the BLL models would also break the model mapping in the DummyWeatherDataRepository(DAL). I may be wrong about this, but this doubt kept me thinking. Thank you once again for your beautiful and easy-to-follow tutorial!
@RahulNath2 жыл бұрын
For any changes in the BLL layer you need it to break (if it has to). Because your business model has changed. But if you are changing this in the DAL it does not have to break anything in business. Hope that makes sense?
@aaqibkhan8360 Жыл бұрын
@@RahulNath Thank you so much for explaining in simple words, I just wanted to know if moving the interface from DAL to BLL was even necessary in this example? There are no DAL references in BLL file after You moved the DTO mapping logic from the BLL to the DAL so Couldn't we keep the interface in DAL itself and return WeatherForecast Object to the Services in the BLL? I hope I am clear.. Thank you in advance!
@RahulNath Жыл бұрын
@@aaqibkhan8360 the interfaces belong to the client in this case the BLL. If we keep the interface in DAL, how will the BLL use it? It will have to refer the DAL project in like before, which is what we wanted to avoid in the first place. Does that answer your question? If not, drop me an email with the solution sample of what you are thinking and I can have a look. Details in my about page.
@sawarkarashish3 жыл бұрын
Thanks Rahul for wonderful explanation of Layering. Can you make videos on different architecture with example like Onion view in this video.. And design patterns with example which use in most projects.
@RahulNath3 жыл бұрын
Great suggestion Ashish, thank you! I will add this to the list and make them soon enough! Let know if you had specific design patterns in mind.
@sawarkarashish3 жыл бұрын
If you explain factory method & abstract factory pattern that will be great. And some architecture like onion view. Thanks in advance ☺
@RahulNath3 жыл бұрын
@@sawarkarashish Sure ok will do - Next video is exploring more of Onion architecture and a refactoring example. Hope you will like it and looking forward to hearing your comments.
@kevinpr0073 жыл бұрын
Hello, thanks for this tutorial. I have a doubt, why transient and not scope?
@RahulNath3 жыл бұрын
Thank you, Kevin. I used transient as a default since this was more focused on showing the layering aspect. Do use what you find more appropriate. Also, do check out this follow up video which might be of interest kzfaq.info/get/bejne/jqthqphj1bS9omw.html
@bhavyashah88473 жыл бұрын
Out of the blues, I want to ask this question related to linq and stored procedure. Which one is faster when it comes to joining, searching and sorting? Should I preform direct operations on table with linq or should I use stored procedures?
@RahulNath3 жыл бұрын
Hey Bhavya Happy that you liked the video! Regarding Linq vs Stored Procedure - It depends. When you say Linq, what are you referring to here? If it's the Entitiy Framework, depending on how you write your query it generates SQL code that is executed at the SQL server. This is a good start to read about it docs.microsoft.com/en-us/ef/core/querying/client-eval?WT.mc_id=AZ-MVP-5003875. Let know if it is something else you referred to with Linq. I will do a video around this some time, so shoot in all your questions regarding it.
@pramodaaskar2933 жыл бұрын
If you get time could you please create video on Asp.Net core Microservice application structure step by step ..choose anything like RabbitMQ or Kafka ..or if you already have similar videos, plz copy the link here .. Great work ..thanks
@RahulNath3 жыл бұрын
Thank you for the suggestion. Yes, I have that on my list and hopefully will reach it soon. Meanwhile, checkout the eshopcontainers sample if you haven't already. It's a great resource github.com/dotnet-architecture/eShopOnAzure
@imarijanovic2 жыл бұрын
H Rahul . By registering IWeatherDataRepository inside your web project you are introducing Web project dependency directly toward DAL project. Should'nt it be done in BLL project so that, like you said, presentation layer do not know anything about DAL? Ivan
@RahulNath2 жыл бұрын
Good point Ivan. In this case the Web Project is the host and acts as the Composition Root (blog.ploeh.dk/2011/07/28/CompositionRoot/) You can split the Web/UI aspects into a different project and have the host app just pull in all dependencies. Hope that clears it?
@yosiyosiro3866 Жыл бұрын
Hi, thanks for sharing. Can you provide the auto-caption in all videos in this playlist or all your videos? Thank you.
@mihailomarjanovic43542 жыл бұрын
Dear Rahul, thank you for this educational video. I would like to ask you, is it a good practice to perform DTO mapping in Repository class ? Cause Solid principle is broken, we add one more feature to our class, beside managing the data from DB, we also add DTO mapping ? Am I correct ?
@RahulNath2 жыл бұрын
Thank you for your comment - You could move the mapping logic out into a separate class, use an extension method, or set up AutoMapper to achieve that. What's important here is that the Repository returns a Domain Object since the interface belongs to the Domain. Hope that answers your question? Do check out the other videos in the Clean Code series here kzfaq.info/sun/PL59L9XrzUa-nuI1jIibFnJpVPZ0vYXyeq
@mihailomarjanovic43542 жыл бұрын
@@RahulNath Yes, but I considered that Data Access layer is not the right place to do DTO mapping. Your Repository class in DAL, contains method for GetDummyData and other one Get method used to map from Model to DTO via Select query. It should be in upper layer, Service layer. Ive subscribed to your channel, thank you for all videos.
@NK-xw4uu3 жыл бұрын
Enjoyed the way you explain. I wanted to ask - since web project only uses the business layer, so at 22:32 why have you added DAL as dependency to the web project? Is this to register it with the DI container?
@RahulNath3 жыл бұрын
Thank you and happy you like it! Yes that is correct it is for the DI. In this case the Web Project also acts as the Composition Root, where the whole application is composed. I talked about this in a related video here kzfaq.info/get/bejne/jqthqphj1bS9omw.html. Let me know if that clarifies your question or if you have additional questions.
@DharmendraKumar-yv1pg2 жыл бұрын
Hi Rahul, Regarding dependency inversion you moved interface from dal to bll and inverted the dependency. But if we modify weatherforecast object in bll then it will also need to update or reflect the changes in dal. It’s like vis-à-vis. Please suggest.
@RahulNath2 жыл бұрын
Yes that is intended - when something changes in your business logic/domain, it's expected to affect your dependencies as well and have them updated accordingly. However if you decide to change the column name or table or the way you store the object it does not have to affect the business layer. Hope that answers your question?
@DharmendraKumar-yv1pg2 жыл бұрын
@@RahulNath thanks for answering. Is there any other way to take care such dependency. Here, we have request flow as UI -> BLL-> DAL and dependencies are totally different.
@RahulNath2 жыл бұрын
@@DharmendraKumar-yv1pg Sorry I didn’t understand the question?
@uzornwachukwu3395 Жыл бұрын
Great video Rahul. I just have one question. Where do we place utility classes like those for sending email/sms in this kind of architecture
@mahansid3 жыл бұрын
Great explanation, but the UI is dependent on both Domain and Infrastructure , doesn’t it violate the encapsulation rule because UI shouldn’t need to know anything about Infrastructure/Data layer ???
@RahulNath3 жыл бұрын
Good point. The project which depends on both Domain and Infrastructure is not the UI in this case. It's the Composition Root or the hosting application. This always needs references to all other projects for the application. The UI Layer in itself can be a separate project or a single page app. I talk about this here kzfaq.info/get/bejne/jqthqphj1bS9omw.html Let me know if that answers your question.
@mahansid3 жыл бұрын
@@RahulNath yes sir, thanks ☺️
@RahulNath3 жыл бұрын
@@mahansid Good to know and call me Rahul! 😀
@barwalgayatri46552 жыл бұрын
Hi Rahul, we created DTO with same PRoperties then isn't it a duplication ?? why u opted different class ??
@RahulNath2 жыл бұрын
In this particular scenario the two classes looks the same. But always this is not the case. At the boundaries the data usually are not in the format that we want in out domain objects. Here is an article that talks more about it blog.ploeh.dk/2011/05/31/AttheBoundaries,ApplicationsareNotObject-Oriented/ Let me know if you have additional questions.
@callegarip3 жыл бұрын
Great Video again. Question, if we have an Update or Add operation with more than 100 fields/properties and I want to pass it in an object rather than 100 parameters to my ADO stored procedure, what would this object be, DTO or the Business Object? What if I want to change the name of the Business Object property, then I would have to update 2 different projects, the BLL and the DAL, right?.... I'd appreciate an answer. Thanks for your vids!
@RahulNath3 жыл бұрын
Glad you like it Victor and great question. Yes it will be an object and you can have an explicit class for it in the DAL layer. If you are using Entity Framework you can also use configurations to map properties to the database columns and you can avoid the extra DTO class. These configurations will live in the Infrastructure/DAL layer. To the question of renaming a property, it depends to what the intent/context of the rename - Is it because the business needs to address that property with a different field or is it just for data storage purposes. If its isolated to the DAL then you can live with only updating the DTO and have the mapping class map to the appropriate property. But if it's a change in domain language then it makes sense to rename across if possible, and yes in that case you will have to rename everywhere. That said if you are doing simple CRUD on these 100 parameters, and not doing any domain level logics or rules, then you might not even need a additional domain layer. Hope that answers your question and happy to assist if you have further questions.
@callegarip3 жыл бұрын
@@RahulNath I really appreciate the quick answer... so in the question #1, if I add an explicit class in the DAL, which honestly it'd make sense for me, but if I do that, when I call my SP from the BLL I have to pass that new class type that live in the DAL which means I have to add a dependency in the BLL project to be able to use that class. In your video you have a reference from the BLL in the DAL which is the opposite. Am I missing something? BTW I DON'T use Entity Framework at all... Thanks again, your videos are awesome!
@RahulNath3 жыл бұрын
@@callegarip The interface will live in BLL. At 20:00 I show how the interface will have the domain type and the DAL layer will do the mapping from DAL DTO to the Domain entity. So the dependency will still be that way - DAL will need the domain/BLL. Does that help? Thank you again and happy you like my videos!
@callegarip3 жыл бұрын
@@RahulNath Yup... I noticed you put the domain type as the return type... so I can pass the same domain type as parameter then let the DAL take it and convert it to the DAL DTO then use the DTO to map the SQLParameters.
@RahulNath3 жыл бұрын
@@callegarip Yes doing that way, the DAL is dependent on the domain object. Now when a domain object changes it is expected to ripple across the different layers because the core of your business/system is changing. However, if something in the outer layer changes it will not affect the core, since it knows nothing about the outer layers. Hope that makes sense.