It really is. I watched a few videos and it was like a cat scratching a blackboard. Either it took a long time for me refresh myself on it or this was explained well. I would like to say its the latter and not the former :).
If you're wondering: the quote on the letterboard is from Goethe. I'm still trying to figure out how it applies to software architecture, which seems to be closer to frozen yoghurt than frozen music.
When I saw that quote, I was thinking of the famous misattributed quip "Writing about music is like dancing about architecture". Both Frank Zappa and Elvis Costello have been credited with this line, concerning music criticism apparently, but both have indicated that they never said it...
Awesome video! I started Python around 6 months ago and have just recently started building larger projects. I realized immediately that software architecture was an entirely different skillset from the algorithm-centric coding problems most people think of when they think of learning to code. I think I actually find architecture the hardest part of SW dev. Love content like this that helps to understand it!
Model View Controller is the architecture pattern that I first learned years ago and I still use most in my work. Watching you explain it though, I did learn how to easily integrate the strategy pattern and the value in doing that. I just wanted to point out that you created the Model, but didn't have it do anything. I do recognize that this was a simple example. But, in this case, your controller class knows too much about the model's implementation and even dominates it. This was most apparent when you cleared the list of IDs, the controller did 'self.model.uuid = [] ', where you may have left it to the model to do this by issuing 'self.model.clearList' and let the model decide how best to clear the list. Still, this was a great walk through to demonstrate the value of good architecture.
Hi Brian - thank you and you’re absolutely right. The model in this example is nothing more than a global variable in fact. Normally, you’d have something more complicated like a database. And then, the model would get the same treatment as the view: add methods for the various operations, and use an abstract class to separate the model from the controller.
@@ArjanCodes by the way, I've read and still have the text you often reference: Design Patterns. After reading it, I refactored a great deal of my code to align with the design principles outlined in the book. And then you came along and started talking about the book and showing some examples in python. So I am now refactoring once again to make things easier and easier to reuse. What's nice about all this is when I need to write something new, I already have an extensive framework because of Design Patterns coupled with your explanations and examples. Cheers mate! Keep up the good work.
I stumbled upon your channel while randomly going through different content and since then i cannot stop watching your videos. Great quality videos with a really nice way of teaching which keeps the video engaging till the very end.
At my current job we use Hexagonal Architecture with Kotlin and Spring, which regardless of being MVC by default has the flexibility to allow clean architectures. I have found hexagonal to be a more convenient than MVC since it allows you to isolate your coro domain modeling and business rules isolated from external stuff such as the framework, the persistency library and so on. However it is worth noting that such a win in terms of maintainbility and low coupling is paid with some additional complexity in the project structure, therefore I would say that it should be assessed whether or not such a pattern is required for a specific project.
Thank you! I enjoyed both the video and playing around with the code. I recently came across your channel and have been enjoying it immensely! For a future video on this architectural pattern, how about adding another alternate version that uses the Observer pattern for Model->View updates. If I remember correctly that is what Martin Fowler refers to as "Observer Synchronisation" in an MVC architecture. In your example you've implemented what he calls "Flow Synchronisation" where the Controller directly updates both the View and the Model directly as part of the input processing flow. With Observer Synchronisation the Controller updates the Model, and the Model notifies one or more Views via an implementation of the Observer pattern.
What is shown in the video looks more like an MVP pattern to me. I have seen many different explanations about the MVC and MVP patterns. Some explain the MVC pattern in the same way as in the video, while others explain the way you explained.
Love your videos Arjan! I am currently using a MVC architecture to build a desktop application using Python for the model and controller, and PyQT for the view. I am struggling to scale up the MVC architecture as the application becomes increasingly complicated. All of the separate layers are becoming very large. The model has been broken into many different subclasses, but the controller and view are still one class each. I am struggling to figure out how to break down the controller and view layer so that I can scale up my application better. Have you thought of doing a part 2 of this video where you show what happens once your application becomes more complicated?
I would love to see a video on Hexagonal Architecture or Clean Architecture. I try to follow it while writing backend services, but your videos always make me realize something knew :)
Another great video making me aware of more to take into consideration 😅 And it is very awesome, that you explain it with a code example and then also use a design pattern to show the diffrence.
Thanks for the great content! In case you're not familiar with Ctrl+D (selecting current and with each hit of "D" the next occurrence) and Ctrl+Shift+L (selecting all occurrences) in vscode yet, i recommend you try those out. It's super helpful when selecting and replacing code. Another nice alternative is F2 (rename variable). :)
Thanks Andreas! I should put in some time to get more familiar with the many shortcut keys in VSCode. The ones you mention are definitely very useful indeed.
Nice videos. I especially like the "Analysis of the new code" part where you link architecture, design pattern and synthax structure. One question to be more general: how would you link, architecture, principle, design pattern and maybe other low level part?
I have an issue with the term "Architecture" in this context. When I think about architecture, I think about more of a big picture perspective, like uncle bobs "Clean Architecture" that's oriented around Boundaries and Dependencies across boundaries. So intuitively I'd see MVC closer to a design pattern or a meta design pattern if you will, because you could see the Controller as a Facade for more complicated logic where a model holds some data and the view determines how to display the model data on a screen. 🤔
I get that, though MVC is clearly noted as an architectural pattern in the industry. The idea is that MVC provides the overall structure of your GUI application and then you use design patterns within that structure. For example, in the model you might use composition to structure the data, in the view you might use the observer pattern to handle UI changes, and in the controller you might use patterns like the strategy to change the logic dynamically.
Great video, but I am not sure about the View class. As far as I know it shouldn't know about the controller at all. In your code, the view is dependent on the controller and vice-versa, and therefore you wouldn't be able to separate those classes to separate files because you would have cyclic references. You even encountered it in the video at 11:27, where you had to move the View class above the Controller class so the type-hint would compile, but you can't add a type hint in the View. I think that the View should receive the functions (or, as someone else suggested here, an abstract class with these functions). Anyway, great video I really love your content 😊🤓👨🏻💻
thanks for this tutorial, very helpful to me :) one thing I would like to ask is at the end final thoughts, you mentioned you are not a big fun of MVC, because at the end, user always wanna something out of the box. I totally agree with this, but any suggestion to choose some framework that can manage this situation?
Hi Arjan, thank you for this great video. I have two comments: 1) In the Model, "uuids" would be a better name since multiple ids are stored. 2) From my point of view, what you showed as strategy pattern is a very basic form of it at best. I am not sure if I would call it "strategy pattern" here. As you know, in the strategy pattern, typically an (abstract) class is used with (abstract) methods where sub classes provide the respctive behavior. I would rather say what you do is constructor-based dependency injection to make the uuid function configurable. But that's just my two cents :)
Often times creating an entire strategy object is unnecessary in languages with first class functions. Especially if you can type safe it with the correct parameters and everything. This is certainly strategy pattern python just simply makes it easier to implement. Also iirc strategy pattern shouldn't have multiple methods, usually the wrapper is just to pass it for constructor injection. If you add multiple strategies in a single class its gonna just start bleeding into other patterns like repository etc.
What is the best software architecture for data science applications, thinking that they must have the sequential steps: collect data, preprocess it, train model, make predictions and save the results?
I'll leave here the feedback I gave you on reddit with the hope that it benefits other viewers not funneled through reddit: I think you did a great job at explaining in simple terms what things are and where they are positioned. However, here some additional input: - in the same bucket as design patterns you should also put anti-patterns; we as an industry talk too little about them - on top of patterns and antipatterns come design principles; we as an industry talk too much about SOLID, but in reality there are over 20 of them. In the same bucket also go anti-principles; we also don't talk enough about them - regarding frameworks: if you let your framework dictate how to do your architecture, you're doing something terribly wrong. I'm afraid elaborating on this would take me too much effort for this post, but you can read between the lines about this on my wiki; if you have concrete questions, please ask - MVC is not an architecture if you really want to do it right. At most, it's a design decision you can have in your Web plugin (think adapter and ports, where a delivery mechanism, here the web, is Plugin) - your example, while showing good design, is too simplistic to explain anything about architecture - examples of architectures: layered, n-tier, ports and adapters; please note that they can be combined in very harmonious ways - above architecture you have architectural principles and anti-principles like: single source of truth, microservices, etc; and no, specific vendors are not architectures, like: using aws is not an architectural decision, it's simply a tooling decision This last point highlights how design and architecture go hand in hand: you have single source of truth at the system level/architecture, but you need to follow through with this also at the design level, for example by making sure that only one object has setters and getters for particular pieces of information, and all other objects delegate to this single source of truth the write and read operations. So all in all, architecture and design go hand in hand.
Thank you Flavius, much appreciated. For completeness, this is the link to the original Reddit post: www.reddit.com/r/softwarearchitecture/comments/ms29z8/what_is_software_architecture_and_how_is_it/?
Thanks for your great video. I think I'll keep watching your tutorial every time you updates. By the way, could you choose some well written code bases and explain some practical uses of design patterns or architectures in that code base like requests or flask ?
What's the right way for the view to get information from the model? In this example, the model contained very little structure, and the view maintained a duplicate of the entire list of uuids, but I imagine that it's not generally the goal to have the view class duplicate the model like this. As an example, suppose I'm coding a checkers game (or something similar). Presumably the model class is the right place for a list of which board spots should have which color checker in them (or be empty). But the view needs this information when it comes time to draw. Would you have the view class maintain a duplicate list of this information? Would you pass the model to the View.setup() function so the view can access the model's information when needed? Would you create a method in the controller so that the view can access the model, but only by going through the controller? Something else?
Why make the abstract View class? Will there be another GUI framework for the future that would necessitate adding a class such as PyQTView, for example?
i think its good if we place the uuid adding and removing function in model class i want to say according to information expert uuid related function have to be in the model class or the main thing it is very tight coupled
Good content to broaden your view on software design. It would be nice if you could compare the architecture of popular python web frameworks(Flask, Django, FastAPI) with pros, cons and potential use cases.
Hi Arjan. Again, thanks for your explanation. What do you think about this possible change in your example code? The TKView class has a usage relationship with the Controller class by the setup method. Maybe the Controller class implements a abstract class, for example the 'Click' class, with the two abstract methods that need TKView to enroll in the framework buttons. Now TKView receive a 'controller: Click' and the view don't have a relation with the controller implementation. The idea is similar when you separated the TKView with the Controller. Best regards!
Good suggestion, I think you certainly further improve separation by making Game less dependent on the view, so you can later on decide to switch out Tkinter with something else and don’t have to change anything in the rest of the game code.
Would it be fair to say that there is a very tight coupling between the Controller and Model and the Controller and View, but that's okay because it's intentional and well defined in a single place?
@@ArjanCodes Great! Love your python videos and I have decided to start from your first video. Will reach here soon :). Amazing content and great production quality videos!
Can u go over how to integrate languages, theres like communication over local host, theres communication over port(?), and theres like foreign function interfaces I think i got (2) wrong, but say i write some part of my arch in rust, its a much better version than my bash library and much more efficient and safe engine feom python, but now i want to use intigrate it within python bc there are no SDKs for rust... what do i do? Do i just write a couple of modules to wrap the Curl interface? If the server sends me down classes (what i would presume is the like modus opperandi for sdks) and a non native json seriable type(s)... do i just implement those or extract data? Do i have to port every type they send me, and port every interface and string reprentable non-primitive object i have to send back???
Thank you for this video! I have a question, At 5:37, why did you leave the passed controller as is instead of making it an attribute of the View class (self.controller) ?
Setting it as a class attribute is surely also an option. I didn’t do it here because it wasn’t needed for this example (everything is patched up in the setup method).
@@ArjanCodes I see! Could you have also used the model and view directly from the __init__ of the Controller instead of making them attributes of the class then?
Why is the controller less dependent on TkView after using the abstract class? You have been using the abstract class in several videos but I can't grasp the benefits yet. Could you elaborate on it a bit more?
The abstract class acts like a separation layer between the different parts of the architecture. If you make the controller dependent on an abstract class instead of TkView directly, you could replace the view by another type of view (for example, QtView) without having to change anything in the controller. So in essence, if you do this in different areas of your code, it will be less work later on to change it.
Because the idea is that ultimately, the Model class will provide an abstraction to the data. In this simple example it doesn’t make a difference, but generally you’ll have a way more complicated model and then it’s important to make this separation.
this is one of the best examples to introduce people to model-view-controller I have ever seen online. Love your videos.
Thank you! Glad you’re enjoying the videos!
It really is. I watched a few videos and it was like a cat scratching a blackboard. Either it took a long time for me refresh myself on it or this was explained well. I would like to say its the latter and not the former :).
quick fix: The Best**
If you're wondering: the quote on the letterboard is from Goethe. I'm still trying to figure out how it applies to software architecture, which seems to be closer to frozen yoghurt than frozen music.
I read it in context of the Disney movie, "software architecture is Frozen music... Let it go, Let it Go Can't hold it back anymore"
When I saw that quote, I was thinking of the famous misattributed quip "Writing about music is like dancing about architecture". Both Frank Zappa and Elvis Costello have been credited with this line, concerning music criticism apparently, but both have indicated that they never said it...
Awesome video! I started Python around 6 months ago and have just recently started building larger projects. I realized immediately that software architecture was an entirely different skillset from the algorithm-centric coding problems most people think of when they think of learning to code. I think I actually find architecture the hardest part of SW dev. Love content like this that helps to understand it!
Model View Controller is the architecture pattern that I first learned years ago and I still use most in my work. Watching you explain it though, I did learn how to easily integrate the strategy pattern and the value in doing that. I just wanted to point out that you created the Model, but didn't have it do anything. I do recognize that this was a simple example. But, in this case, your controller class knows too much about the model's implementation and even dominates it. This was most apparent when you cleared the list of IDs, the controller did 'self.model.uuid = [] ', where you may have left it to the model to do this by issuing 'self.model.clearList' and let the model decide how best to clear the list. Still, this was a great walk through to demonstrate the value of good architecture.
Hi Brian - thank you and you’re absolutely right. The model in this example is nothing more than a global variable in fact. Normally, you’d have something more complicated like a database. And then, the model would get the same treatment as the view: add methods for the various operations, and use an abstract class to separate the model from the controller.
@@ArjanCodes I noticed the additional functionality you added to the Model class in Github. Thanks! I bought you a cup of coffee.
I know the youtube algorithm loves
Thank you very much! Yeah, the algorithm definitely favors shorter videos, which is not always best for explaining software design topics.
@@ArjanCodes by the way, I've read and still have the text you often reference: Design Patterns. After reading it, I refactored a great deal of my code to align with the design principles outlined in the book. And then you came along and started talking about the book and showing some examples in python. So I am now refactoring once again to make things easier and easier to reuse. What's nice about all this is when I need to write something new, I already have an extensive framework because of Design Patterns coupled with your explanations and examples.
Cheers mate! Keep up the good work.
Fridays are even better now that I found this channel!
Thanks Caleb! :)
Please do more software architecture videos. Your design pattern videos are amazing but the architecture bread and butter is what I need in my life 😄
for real this channel is going to hit 100k in like 4 months
Let's see, not making any predictions for the moment! :)
This is a great way to have the video, show all the code be written in real time (sped up but not too fast), with a small box with you talking in it.
Thanks so much Roddy, glad you liked it!
Your playlist is one of the best videos about software design . Thanks
Thank you!
Best example I could find about a MVC using python for desktop application. Thanks!
Great video! I admire detailed description boxes a lot, this looks like a sign of a channel which will blow up soon.
Happy you liked it! I’ll make sure to keep filling up the descriptions, hope it helps, haha 😊.
I stumbled upon your channel while randomly going through different content and since then i cannot stop watching your videos. Great quality videos with a really nice way of teaching which keeps the video engaging till the very end.
Thank you, happy you like the videos!
At my current job we use Hexagonal Architecture with Kotlin and Spring, which regardless of being MVC by default has the flexibility to allow clean architectures. I have found hexagonal to be a more convenient than MVC since it allows you to isolate your coro domain modeling and business rules isolated from external stuff such as the framework, the persistency library and so on. However it is worth noting that such a win in terms of maintainbility and low coupling is paid with some additional complexity in the project structure, therefore I would say that it should be assessed whether or not such a pattern is required for a specific project.
It is useful. It is quite surprised that many software engineers don't care about software architecture in production code.
Thank you! I enjoyed both the video and playing around with the code. I recently came across your channel and have been enjoying it immensely! For a future video on this architectural pattern, how about adding another alternate version that uses the Observer pattern for Model->View updates. If I remember correctly that is what Martin Fowler refers to as "Observer Synchronisation" in an MVC architecture. In your example you've implemented what he calls "Flow Synchronisation" where the Controller directly updates both the View and the Model directly as part of the input processing flow. With Observer Synchronisation the Controller updates the Model, and the Model notifies one or more Views via an implementation of the Observer pattern.
What is shown in the video looks more like an MVP pattern to me. I have seen many different explanations about the MVC and MVP patterns. Some explain the MVC pattern in the same way as in the video, while others explain the way you explained.
Enjoying each of this video series. Can you do more videos about this topic? thanks!
Love your videos Arjan! I am currently using a MVC architecture to build a desktop application using Python for the model and controller, and PyQT for the view. I am struggling to scale up the MVC architecture as the application becomes increasingly complicated. All of the separate layers are becoming very large. The model has been broken into many different subclasses, but the controller and view are still one class each. I am struggling to figure out how to break down the controller and view layer so that I can scale up my application better. Have you thought of doing a part 2 of this video where you show what happens once your application becomes more complicated?
I would love to see a video on Hexagonal Architecture or Clean Architecture. I try to follow it while writing backend services, but your videos always make me realize something knew :)
thanks for the great video! I'm suprised at how good tkinter buttons look on a mac, without any modifications.
Discovered your channel a few weeks ago. Great stuff! Keep it up. Groetjes uit België beste Noorderbuur!
Hi Michael, dankjewel! Happy you’re enjoying the videos.
Thank you so much sir. I learnt alot of advance stuffs from your videos.
Simple and nice explanation, I like the way you explained the concepts.
Thank you so much 🙂
this video was amazing for me, like your videos in general. just thank you!
I've been looking for this kind of content for a while. Just subscribed!
Thank you Lester, glad you’re enjoying the content!
This was a really great video! Finally showing the architecture in practice!
Found another great channel. Kudos.
Excellent sir, thanks for posting. Content is simply precise and perfect. Please post more.
Thanks so much, will do!
Very good example! Thank you!
Another great video making me aware of more to take into consideration 😅 And it is very awesome, that you explain it with a code example and then also use a design pattern to show the diffrence.
Thanks IceCrasher! The examples require always a bit of preparation, but I agree they are crucial to clarify how everything fits together.
@@ArjanCodes Now only a UML class diagramm is missing and then it would be perfekt :)
Thanks for the great content! In case you're not familiar with Ctrl+D (selecting current and with each hit of "D" the next occurrence) and Ctrl+Shift+L (selecting all occurrences) in vscode yet, i recommend you try those out. It's super helpful when selecting and replacing code. Another nice alternative is F2 (rename variable). :)
Thanks Andreas! I should put in some time to get more familiar with the many shortcut keys in VSCode. The ones you mention are definitely very useful indeed.
Nice videos. I especially like the "Analysis of the new code" part where you link architecture, design pattern and synthax structure. One question to be more general: how would you link, architecture, principle, design pattern and maybe other low level part?
I have an issue with the term "Architecture" in this context. When I think about architecture, I think about more of a big picture perspective, like uncle bobs "Clean Architecture" that's oriented around Boundaries and Dependencies across boundaries. So intuitively I'd see MVC closer to a design pattern or a meta design pattern if you will, because you could see the Controller as a Facade for more complicated logic where a model holds some data and the view determines how to display the model data on a screen.
🤔
I get that, though MVC is clearly noted as an architectural pattern in the industry. The idea is that MVC provides the overall structure of your GUI application and then you use design patterns within that structure. For example, in the model you might use composition to structure the data, in the view you might use the observer pattern to handle UI changes, and in the controller you might use patterns like the strategy to change the logic dynamically.
Thanks for your big job. I watched all of your videos. It's awsome.
Glad you like them!
Great video, but I am not sure about the View class. As far as I know it shouldn't know about the controller at all.
In your code, the view is dependent on the controller and vice-versa, and therefore you wouldn't be able to separate those classes to separate files because you would have cyclic references. You even encountered it in the video at 11:27, where you had to move the View class above the Controller class so the type-hint would compile, but you can't add a type hint in the View.
I think that the View should receive the functions (or, as someone else suggested here, an abstract class with these functions).
Anyway, great video I really love your content 😊🤓👨🏻💻
Good point! It would indeed be better if the view has no knowledge of the controller. I might revisit this in a future video.
thanks for this tutorial, very helpful to me :) one thing I would like to ask is at the end final thoughts, you mentioned you are not a big fun of MVC, because at the end, user always wanna something out of the box. I totally agree with this, but any suggestion to choose some framework that can manage this situation?
Hi Arjan, thank you for this great video. I have two comments: 1) In the Model, "uuids" would be a better name since multiple ids are stored. 2) From my point of view, what you showed as strategy pattern is a very basic form of it at best. I am not sure if I would call it "strategy pattern" here. As you know, in the strategy pattern, typically an (abstract) class is used with (abstract) methods where sub classes provide the respctive behavior. I would rather say what you do is constructor-based dependency injection to make the uuid function configurable. But that's just my two cents :)
Often times creating an entire strategy object is unnecessary in languages with first class functions. Especially if you can type safe it with the correct parameters and everything. This is certainly strategy pattern python just simply makes it easier to implement. Also iirc strategy pattern shouldn't have multiple methods, usually the wrapper is just to pass it for constructor injection. If you add multiple strategies in a single class its gonna just start bleeding into other patterns like repository etc.
Awesome Arjan what books do you recommend to read more about mvc in python?
thank you so much. Learning python is a thing, doing it well is another :)
Thanks so much David, glad you liked it!
What is the best software architecture for data science applications, thinking that they must have the sequential steps: collect data, preprocess it, train model, make predictions and save the results?
I'll leave here the feedback I gave you on reddit with the hope that it benefits other viewers not funneled through reddit:
I think you did a great job at explaining in simple terms what things are and where they are positioned.
However, here some additional input:
- in the same bucket as design patterns you should also put anti-patterns; we as an industry talk too little about them
- on top of patterns and antipatterns come design principles; we as an industry talk too much about SOLID, but in reality there are over 20 of them. In the same bucket also go anti-principles; we also don't talk enough about them
- regarding frameworks: if you let your framework dictate how to do your architecture, you're doing something terribly wrong. I'm afraid elaborating on this would take me too much effort for this post, but you can read between the lines about this on my wiki; if you have concrete questions, please ask
- MVC is not an architecture if you really want to do it right. At most, it's a design decision you can have in your Web plugin (think adapter and ports, where a delivery mechanism, here the web, is Plugin)
- your example, while showing good design, is too simplistic to explain anything about architecture
- examples of architectures: layered, n-tier, ports and adapters; please note that they can be combined in very harmonious ways
- above architecture you have architectural principles and anti-principles like: single source of truth, microservices, etc; and no, specific vendors are not architectures, like: using aws is not an architectural decision, it's simply a tooling decision
This last point highlights how design and architecture go hand in hand: you have single source of truth at the system level/architecture, but you need to follow through with this also at the design level, for example by making sure that only one object has setters and getters for particular pieces of information, and all other objects delegate to this single source of truth the write and read operations.
So all in all, architecture and design go hand in hand.
Thank you Flavius, much appreciated. For completeness, this is the link to the original Reddit post: www.reddit.com/r/softwarearchitecture/comments/ms29z8/what_is_software_architecture_and_how_is_it/?
As always great job i love yours approaches to share your knowledge
It would be great working with you
Thanks for your great video. I think I'll keep watching your tutorial every time you updates. By the way, could you choose some well written code bases and explain some practical uses of design patterns or architectures in that code base like requests or flask ?
Thanks for the suggestion! I'll definitely think about doing a video about backend API building and/or http requests.
What's the right way for the view to get information from the model? In this example, the model contained very little structure, and the view maintained a duplicate of the entire list of uuids, but I imagine that it's not generally the goal to have the view class duplicate the model like this.
As an example, suppose I'm coding a checkers game (or something similar). Presumably the model class is the right place for a list of which board spots should have which color checker in them (or be empty). But the view needs this information when it comes time to draw. Would you have the view class maintain a duplicate list of this information? Would you pass the model to the View.setup() function so the view can access the model's information when needed? Would you create a method in the controller so that the view can access the model, but only by going through the controller? Something else?
Why make the abstract View class? Will there be another GUI framework for the future that would necessitate adding a class such as PyQTView, for example?
Awesome video, keep up the incredible work! :)
Thank you! Good luck also to you with your channel, very well done and interesting topics.
i think its good if we place the uuid adding and removing function in model class i want to say according to information expert uuid related function have to be in the model class or the main thing it is very tight coupled
Wow, best video yet!
Glad you enjoyed it, Joshua!
Good content to broaden your view on software design. It would be nice if you could compare the architecture of popular python web frameworks(Flask, Django, FastAPI) with pros, cons and potential use cases.
Glad you liked it Robert, and thank you for the suggestion!
Very inspirational. Thanks!
Thanks so much, glad you liked it!
Great video as always, greetings from chile :D
Thank you very much, David!
Hi Arjan.
Again, thanks for your explanation.
What do you think about this possible change in your example code?
The TKView class has a usage relationship with the Controller class by the setup method. Maybe the Controller class implements a abstract class, for example the 'Click' class, with the two abstract methods that need TKView to enroll in the framework buttons. Now TKView receive a 'controller: Click' and the view don't have a relation with the controller implementation.
The idea is similar when you separated the TKView with the Controller.
Best regards!
Good suggestion, I think you certainly further improve separation by making Game less dependent on the view, so you can later on decide to switch out Tkinter with something else and don’t have to change anything in the rest of the game code.
your videos are diamonds
thank you for your great content ,can you make video about django ARCHITECTURE
Thank you for the suggestion!
Awesome video! Congratulations.
Thank you Victor!
Would it be fair to say that there is a very tight coupling between the Controller and Model and the Controller and View, but that's okay because it's intentional and well defined in a single place?
Great video! Can you do a video on singleton pattern which can be used as a decorator?
Thanks! I actually did this video a while ago, perhaps you find it helpful: ruclips.net/video/Rm4JP7JfsKY/видео.html.
@@ArjanCodes Great! Love your python videos and I have decided to start from your first video. Will reach here soon :). Amazing content and great production quality videos!
Thank you, glad you like the videos! Let me know what you finally end up with!
Is it possible to have multiple controllers in an app using the model view controller pattern?
Can u go over how to integrate languages, theres like communication over local host, theres communication over port(?), and theres like foreign function interfaces
I think i got (2) wrong, but say i write some part of my arch in rust, its a much better version than my bash library and much more efficient and safe engine feom python, but now i want to use intigrate it within python bc there are no SDKs for rust... what do i do?
Do i just write a couple of modules to wrap the Curl interface? If the server sends me down classes (what i would presume is the like modus opperandi for sdks) and a non native json seriable type(s)... do i just implement those or extract data?
Do i have to port every type they send me, and port every interface and string reprentable non-primitive object i have to send back???
AMAZING! thanks Arjan
Glad you like it!
Really cool video!
Thank you!
I wish I came to know about your channel earlier sir!
Glad you found me anyway :).
How do I start implementing these in my projects?
Thank you for this video! I have a question, At 5:37, why did you leave the passed controller as is instead of making it an attribute of the View class (self.controller) ?
Setting it as a class attribute is surely also an option. I didn’t do it here because it wasn’t needed for this example (everything is patched up in the setup method).
@@ArjanCodes I see! Could you have also used the model and view directly from the __init__ of the Controller instead of making them attributes of the class then?
Why is the controller less dependent on TkView after using the abstract class? You have been using the abstract class in several videos but I can't grasp the benefits yet. Could you elaborate on it a bit more?
The abstract class acts like a separation layer between the different parts of the architecture. If you make the controller dependent on an abstract class instead of TkView directly, you could replace the view by another type of view (for example, QtView) without having to change anything in the controller. So in essence, if you do this in different areas of your code, it will be less work later on to change it.
Great video 👍
Thanks !
Very nice video, thx for sharing ! :)
Thank you @yoyonel1808, happy you enjoyed it!
so how do you get that darkmode tkinter ?
thanks for this
You're welcome
why isn't lisvariable and textvariable used? wouldn't it make managing values of widgets better?
*listvariable
Wow, this is great.
Thank you Joshua, glad you liked it.
great great great stuff
Thanks so much Michal!
Bro, do you have a paypal option. I can't put my card details. I really love your teaching this video. Thanks
Unfortunately, no. But thank you anyway for trying!
The model class is redundant. Why not just use the list directly as the model?
Because the idea is that ultimately, the Model class will provide an abstraction to the data. In this simple example it doesn’t make a difference, but generally you’ll have a way more complicated model and then it’s important to make this separation.
I use the spaghetti architecture.
It's the best architecture ever. Especially combined with the "pesto" architectural layer.