Finally a video about this topic that actually makes sense and not a 20 minutes long time-waste.
Thank you dear Milan. question about Models: 1- In [CommandHandlers] & [QueryHandlers] we have [Request Class] which is inherited from [IRequest]. 2- [Commands & Queries] class play a role like DTO which are used by handler class as input parameter. 3- [Queries] return a model and generally shall be different from [Domain] classes. If it is identical to [Domain] class, we create similar class (DTO) but don't expose domain class to upper layer. 4- So far, we have classes (Like Model) for commands (input) & queries (input) & DTO (output). 5- Item 1~4 can be used in API project and API project can be execute in server. 6- But, Client is a different project (WebApplication/WindowsForm/Android/…) and for sending/receiving data to/from API we need to have [Input Model] for command & query and get data in DTO format. Question: As mentioned above, is it suggested to define new command/query/DTO classes in different project (Not in Application/Infrastructure layers) to reference them to [Client] project so, we do not have to create extra and identical classes? Is it accepted? To clarify my previous question: Is it possible to create [Model] class (input and output) in separate class library and reference them to all other projects? In this way, [Command] class can inherit from [DTO+IRequest] together.
Very good examples and great advice for good practices! You are a great teacher
thanks, even for Senior devs, this is a great refresher
Thanks for this, Milan. Your content is always top-notch.
simply the best! simple and to the point. Thank you
Very nice, like always. I'd agree with (at least one) comment that I saw asking for a mini app that implements all of this, because theory is nice, but seeing it actually in practice is even better. It doesn't have to have cqrs with mediatr or use a real db nor be a web app. It can just be a simple console app that fetches some data from in memory database. For example a library where you can list all the books or all the authors, you can add or remove books and/or authors. You can have some business rules like a book can't have more than 2 authors... I think it'd benefit the community a lot :)
Looking forward to talking more about the modular monolithic architecture
I'm truly fascinated by this topic, thanks to your excellent explanation. I aspire to reach your level of knowledge in the future.
Amazing content, thank you for this playlist about Clean Architecture, DDD and related topic
I might be even more opinionated around what is allowed in the application layer, since I mostly like the functional core imperative shell version of clean architecture. That means that no side effect/ I/O is allowed when invoking methods outside the outer layers. Since I/O means unpredictability in the business logic this must be done carefully, since business logic should not depend on side effects while the outer shell can do so 👍
An excellent explanation about clean architecture. 🙂
Hi Milan, i watch your content from a long time and also like it. I have a request can you try to keep content as beginner friendly so that if we share videos to someone, even if he has no context he can learn it easily and quickly
as always.. you are awesome, I wrote the following message before seeing the end of your video, { Is there any chance that we can see you create a mini system of your choice to show for your follow how the systems build in real world, how we should implement design principles, design patterns in the real world, how we do that after analysing the idea, how we convert it to diagram maybe, or to tasks using agile.. scrum or kanban, how to manage git effectively, how to publish it to azure or aws.. I know it's alot, if you'd like to do that.. make it on a paid platform and I'm sure most of your followers will participate } I wrote that before seeing the end of your video 😂 I hope two things about your course, first it's starting from scratch or let us say for bignner not for the people how have master degree as you do here in YouTube, second it's convert the subjects that I mentioned above. thanks alot
Please no offense, The issue with all your CA videos (at least for me) is that in all of them you either don't show an actual project or even when you do, you never show the folders/files structures or hierarchies. I've watched many of your videos yet couldn't figure out how to setup even a basic CA project. Suggestion: 1- Create a new .NET project 2- Create the needed folders 3- Place each file to its relative folder. e.g. Controller, Repo, Entity/Model, Dto, Db, etc. 4- Explain how they are connected and related to each other. If I would rank C# YouTube videos based on being practical and helpful: #1 kudvenkat (the best) #2 IAmTimCorey #2 You #3 Nick Chapsas (the worst) I hope it helps you improve your contents. To be honest some of your videos are just great I have to add that. Best regards.
A good guidance !
Thank you for this video. I have bin trying to find out where the API should go in clean Architecture but no one was giving a straight forward answer has you did here. I just have one more thing for you to clear up. The UI(Angular,React,Blazor) should this also go in the Presentation layer?
Thanks Milan I have a question about file upload, Is it ok if used IFormFile in Application project as a parameter in the IRequest class/record public record CreateArticleRequest(string Title, string Content, IFormFile ThumbnailImage) : IRequest<Result<CreateArticleResponse>>; or create a custom class and map IFormFile to it in the controller public record CreateArticleRequest(string Title, string Content, FileUploader ThumbnailImage) : IRequest<Result<CreateArticleResponse>>; public async Task<IActionResult> CreateArticle([FromForm]CreateArticleRequest command,[FromForm] IFormFile formFile) { command.FileUpoader = formFile.MapToFileUploader(); //... } or you have a better approach ?
Thanks! Repository abstraction, in my opinion, should be at the application layer. It has nothing to do with the core business logic
@MilanJovanovicTech