Which Software Architecture Should You Use: MVC, MVP, or MVVM?

  Рет қаралды 108,561

ArjanCodes

ArjanCodes

Күн бұрын

Which GUI software architecture should you use in your project: MVC, MVP, or MVVM? In this video, I break down the pros and cons of each approach, so you can make the best decision for your project.
The code I worked on in this tutorial is available here: github.com/ArjanCodes/2022-gui.
🚀 Next-Level Python Skillshare Class: skl.sh/3ZQkUEN
💡 Get my FREE 7-step guide to help you consistently design great software: arjancodes.com/designguide.
💻 ArjanCodes Blog: www.arjancodes.com/blog
🎓 Courses:
The Software Designer Mindset: www.arjancodes.com/mindset
The Software Designer Mindset Team Packages: www.arjancodes.com/sas
The Software Architect Mindset: Pre-register now! www.arjancodes.com/architect
Next Level Python: Become a Python Expert: www.arjancodes.com/next-level...
The 30-Day Design Challenge: www.arjancodes.com/30ddc
🛒 GEAR & RECOMMENDED BOOKS: kit.co/arjancodes.
👍 If you enjoyed this content, give this video a like. If you want to watch more of my upcoming videos, consider subscribing to my channel!
💬 Discord: discord.arjan.codes
🐦Twitter: / arjancodes
🌍LinkedIn: / arjancodes
🕵Facebook: / arjancodes
📱Instagram: / arjancodes
👀 Code reviewers:
- Yoriz
- Ryan Laursen
- James Dooley
- Dale Hagglund
🎥 Video edited by Mark Bacskai: / bacskaimark
🔖 Chapters:
0:00 Intro
1:28 Example explanation
3:18 Model-View-Controller (MVC)
9:23 Model-View-Presenter (MVP)
18:24 Model-View-Viewmodel (MVVM)
19:49 PyQt
22:44 Model-Template-View (MTV)
23:30 Outro
#arjancodes #softwaredesign #python
DISCLAIMER - The links in this description might be affiliate links. If you purchase a product or service through one of those links, I may receive a small commission. There is no additional charge to you. Thanks for supporting my channel so I can continue to provide you with free content each week!

Пікірлер: 145
@ArjanCodes
@ArjanCodes 9 ай бұрын
💡 Get my FREE 7-step guide to help you consistently design great software: arjancodes.com/designguide.
@djl3009
@djl3009 Жыл бұрын
Thank you! Really, really, really well done! -- well worth the wait! The level of skill in condensing all these relatively "involved" topics into a single twenty-or-so minute video is a noteworthy feat in itself.
@ErikS-
@ErikS- Жыл бұрын
20:40 - "I hate XML" This is where the Dutch are renowned for: the directness and the "no-nonsense"-attitude. Maybe it is just part of the "design principles" or "architecture" of the dutch😜 And I - as a dutch guy myself - are proud of it! It is a very effective way of teaching stuff imo. So I am happy that Arjan also keeps this no-nonsense principle in his videos!
@ArjanCodes
@ArjanCodes Жыл бұрын
Thanks! I'm glad that you appreciate it.
@PierreChevallier
@PierreChevallier Жыл бұрын
Thank you so so so much! I swear its been months now since I'm looking for a clear explanation about the difference between the 3, browsing the Internet without finding clear examples. I finally understand the difference, and I'd like to thank you for this!
@MostafaZeinali
@MostafaZeinali Жыл бұрын
Thanks for the great video. Specially the final point which was: "Separate Things". I'd just add some sprinkles of patterns here and there such as: - Data Binding is sometimes done with an implementation of the "Observer Pattern" (Is it "sometimes" or always? I'm not sure!) - Make sure your "model" also separates the "data layer" and the "logic" layer. - A good starting point for the logic layer's design is the "Command Pattern". (Imagine if you want to implement "undo" for your app) - One good pattern for the data layer is the repository pattern and it is also concerned with your ORM of choice (which I hear is falling out of favor with people these days!) One good way of thinking about separation is "Can I unplug this layer, and plug in a different implementation of this layer without changing other layers?" For example, can I change the view of my Todo App to a CLI? If your MV?? is written cleanly, you should be able to have a CLI up, and also a GUI up on the same backend, with no problem. This could actually be a fun exercise... hmmm... For one thing, your observer pattern impl should be strong, imagine your CLI deletes a task, and your GUI should be updated automagically!
@marcotroster8247
@marcotroster8247 Жыл бұрын
I like your enthusiasm about architecture, but I have to disagree with your point on "abstracting to allow for plugging in a CLI instead of the UI". It's never a good idea to overengineer. If there's no user need to add the abstraction, then don't put the damn code in. Also it's really hard to reason about an abstraction of two things when one of them doesn't exist yet. You'll inevitably end up with some completely wrong abstraction that's going to stand in your way due to unnecessary coupling once you'll need to make a change. This will screw up your productivity. Honestly, the best advice I can give is that you don't overengineer for hypothetical cases. Just keep your code flexible such that it'll be easy to put the code in once it's actually needed. Don't repeat the same design misstakes over and over again 😅😅😅
@lawrencedoliveiro9104
@lawrencedoliveiro9104 Жыл бұрын
I think with nearly any GUI app, if it becomes really useful, then somebody will want to automate tasks with it. This is a good argument for separating the GUI frontend from the backend engine. So then you can invoke the backend via some kind of script or CLI, independent of the GUI. In fact, you could start your new app by writing it as CLI-only, and adding a GUI later.
@marcotroster8247
@marcotroster8247 Жыл бұрын
@@lawrencedoliveiro9104 Why do you write GUIs for stuff that can be entitely automated? Makes no sense at all 😄 And yeah, if you keep the code clear and simple, you can easily copy the stuff that does the logic and separate it lateron to launch it from your script. Well designed code is flexible and can be taken apart. It doesn't always require patterns to achieve something. In fact, patterns constrain your possibilities 🤔😉
@UNgineering
@UNgineering Жыл бұрын
From what I understand, the MVC architecture was meant to be used on a small scale, so there would be a M-V-C for a button, or at worst, for a single form, another MVC for a dialog box, etc. Normally, you would not have a single Model, View, and Controller for the entire application. I guess we'd have to ask Trygve about it :)
@markhathaway9456
@markhathaway9456 Жыл бұрын
I think there have been multiple interpretations of MVC (and most things in the computer world for that matter) and applying it to a very small thing or a small app or even a large app which happens to have a very simple structure is still good. The overly OOPy attempt to connect everything together object-to-object is just a good idea over-done.
@kennethgee2004
@kennethgee2004 Жыл бұрын
In MVC, the view is not supposed to knowledge about the model. Normally, the data from the model is passed as an enumerated object, so that the view is unable to modify the data. Any request to change data from the view should be passed back into the control as an end point action that will then prompt the controller to tell the model to update with the new values.
@n8style
@n8style Жыл бұрын
Great video with the best explanation of all 3 I've ever seen or read! Thank you!
@ArjanCodes
@ArjanCodes Жыл бұрын
You're very welcome!
@davidjnevin
@davidjnevin Жыл бұрын
Just what I was looking for. Thanks!
@ArjanCodes
@ArjanCodes Жыл бұрын
Glad I could help!
@NostraDavid2
@NostraDavid2 Жыл бұрын
Next video about Layers? You could go into dependencies and keeping a check on which layer depends on which layer(s), how many layers you could theoretically have and what the typical style is. I think Software Architecture beyond explaining MVC is needed :)
@ArjanCodes
@ArjanCodes Жыл бұрын
Thanks for the suggestion!
@davidl3383
@davidl3383 Жыл бұрын
Thank you to share so much and help to to do clean code. Architecture is the most complexe for me who just start to learning python
@petrnovota8238
@petrnovota8238 Жыл бұрын
Great video. I have been mostly backend developing and this is a great introsuction to frontend arhitecture. I cant wait to find a new project where I can use it.
@marcotroster8247
@marcotroster8247 Жыл бұрын
Classic 😂😂😂 Keep it up!
@ArjanCodes
@ArjanCodes Жыл бұрын
Glad you enjoyed it!
@loic1665
@loic1665 Жыл бұрын
Thanks a lot for this video! This one comes in really good timing, I am currently in the process of deciding what framework and architecture we will use for a GUI app
@ArjanCodes
@ArjanCodes Жыл бұрын
You're very welcome!
@rrwoodyt
@rrwoodyt Жыл бұрын
Puns still appreciated. 🙂 And MVP is nice in how decoupled things are.
@cven2457
@cven2457 Жыл бұрын
I really struggled with my first gui project and this is exactly what I needed!
@ArjanCodes
@ArjanCodes Жыл бұрын
Glad it helped!
@appuser
@appuser Жыл бұрын
Great video, huge thanks Arjan.
@ArjanCodes
@ArjanCodes Жыл бұрын
You’re welcome- glad you liked it!
@appuser
@appuser Жыл бұрын
@@ArjanCodes Loved it!
@whoshotdk
@whoshotdk Жыл бұрын
I use MVC slightly differently but it works for me; Models publish events to one or more views via some abstraction i.e EventBus or interfaces. Controllers get a reference to the appropriate model class in their constructor and call functions on the model directly. The model can publish events to notify views of changes whenever needed - there is no need to couple the controller to the view.
@Vaibhav_Kumar_2003
@Vaibhav_Kumar_2003 6 ай бұрын
Did MVC using JSP & servlets and was curious on trying it with python. so this was quite helpful. Thnx
@spitsmuis4772
@spitsmuis4772 Жыл бұрын
I have found GUI programming one of the most difficult to do "properly" (i.e. have the feeling of doing things more or less "right"). How do these concepts scale to more complicated GUIs? Does each "thing" have its own model, view and controller? What architecture would you go for if you wanted to support multiple GUI frameworks (GTK, Qt, curses, ....)
@st8113
@st8113 Жыл бұрын
You use as many models as you need to represent all the kinds of data used in your application, and then reuse those models wherever that kind of data is needed. That could definitely be in many different parts of the UI. It'd be less common to reuse a controller, but there may be some circumstances - e.g. an 'easy' simplified UI flow versus a fully configurable UI flow might use the same controller because they're achieving the same thing.
@incremental_failure
@incremental_failure Жыл бұрын
Fun begins when you're using proxy models and views that change multiple models. Good times!
@lawrencedoliveiro9104
@lawrencedoliveiro9104 Жыл бұрын
I started my career back in the early Apple Macintosh days. Back then, there was this document called the “User Interface Guidelines”, which carefully spelled out concepts like “interface stability” and “progressive disclosure” and feedback to confirm user actions. We were taught to care about actual user-interface testing, rather than just assuming that what we were doing would be “intuitive” to the user. But increasingly, I found that app vendors didn’t bother following these rules. And even Apple itself seemed to be moving away from them. Nowadays, it all seems to be about looks and following fashionable “design trends”. Hence the move away from the “3D” look to the “flat” look, which may be going back to “3D” now. Or what about this “dark theme” fad? What happened to usability testing? Seems nobody even bothers with that any more.
@asherrfacee
@asherrfacee Жыл бұрын
I’ve always used MVVM. It’s very similar to MVP. A common binding library for web dev today would be React, but nearly all web dev frameworks are just complicated binding protocols: Backbone, KnockoutJS, AngularJS, Angular 2, Angular what-ever-it-is-now, Ember, Dojo.
@recarsion
@recarsion Жыл бұрын
Hi Arjan, can we get a similar video about backend architecture, if one doesn't exist already? It would be almost the same probably, except instead of a UI you're dealing with things like API endpoints, HTTP requests etc. To be honest GUI development in general and especially desktop GUI seem like a nightmare to me lol.
@borisrunakov1662
@borisrunakov1662 Жыл бұрын
Thank you very much for this ! Could we have an example on how to split a big project into smaller ViewModels with MVVM and how ViewModels should communicate with each other?
@YCLP
@YCLP Жыл бұрын
Where should the responsibility be to check if input is valid? To clarify my question, let's take your example and say you want to disallow adding a task that already exists. What is the proper way to do it? I see two very distinct options: - Should the controller/presenter check if the task already exists? - Should the model check if adding the task is possible and throw an exception of that's not the case? (Which the controller/presenter catches) I can make a case for either, but maybe I'm missing a third option. Would love to hear an expert opinion on this!
@markhathaway9456
@markhathaway9456 Жыл бұрын
Great question because it seems to overlap both the View and the Controller. It's quite common. I think where those meet is at the junction of the Controller (of app logic) and the Model (a human construct representing ideas and implementation of things with data). Which is best? After the Controller checks the data you're updating the model or after the Model checks the data the Model is updated. If the checking has to do with the "business logic" (is the value valid for a purchase or interest rate or pressure level) then it probably belongs in the Controller, but if it's a presentation issue or if the values are in the proper form for the model to store, then it would belong in the Model area.
@svenanton698
@svenanton698 Жыл бұрын
Ruby on Rails is the perfect example of MVC. People may argue in articles about what MVC means, but Rails has proven benefits of MVC with their approach and refined it over years so one could even say that Rails kinda defines the MVC standard.
@Mari_Selalu_Berbuat_Kebaikan
@Mari_Selalu_Berbuat_Kebaikan Жыл бұрын
Let's always do good 🙏
@MrAvalon20
@MrAvalon20 10 ай бұрын
Great video. Any guidance on how you might combine the 3 different components (I.e. M+V+C), with the idea of having separate files, on a class by class basis?
@rain-er6537
@rain-er6537 5 ай бұрын
MVP is beautiful!
@justadude8716
@justadude8716 11 ай бұрын
After weeks of reading articles and books, this video ultimately showed me that these architectures are just tools. They aren't clearly defined, and they shouldn't be, because no application is a 100% fit. But from my experience I enjoy working with MVC in web apps, and MVP for native apps. I never used MVVM but I will have to try it with WPF some time. Thank you for making this video, it is very high quality and I love the examples you provide.
@ArjanCodes
@ArjanCodes 10 ай бұрын
Glad it was helpful!
@nfredrik
@nfredrik Жыл бұрын
Would it be relevant to use an Observer-pattern in the MVP-case? View as observer and Model as subject? Simpler solution?
@Gasnaald
@Gasnaald Жыл бұрын
@ArjanCodes Do you have any tips on how to handle opening an extra window for example for a progress bar with the MVP architecture? Would you create an extra view and pass that on to the presenter?
@Zale370
@Zale370 Жыл бұрын
TLDR: - Model-View-Controller (MVC) separates the application into 3 parts: the model, which represents the data and logic, the view, which represents the user interface, and the controller, which manages user input and interacts with the model and view. - Model-View-Presenter (MVP) is similar to MVC, but shifts more of the responsibility from the controller to the presenter, which acts as a mediator between the view and model. - Model-View-ViewModel (MVVM) is a variation of MVP that uses data binding to automatically update the view when the underlying data changes. - Django's architecture is referred to as an MTV architecture, where the view delegates to a template for presentation and the framework serves as the controller. The exact architecture to use in a particular situation is not rigid and depends on the platform, the project, and personal preference. The most important thing is to separate concerns and avoid creating one large, tightly-coupled God class.
@dmytrokorbanytskyi1586
@dmytrokorbanytskyi1586 Жыл бұрын
Nice work, very informative! Btw, how did you delete the params so fast at 11:30?
@gautamj7450
@gautamj7450 Жыл бұрын
I think he’s using a vim extension, and “dt)” might have been the vim command
@OnlyElf
@OnlyElf Жыл бұрын
Thanks for another great video. It's a pity that in the MVVM example you left out the real database. It would be instructive to see how to save the data to the database.
@Matt-iy2cf
@Matt-iy2cf Жыл бұрын
Great video! It would be nice though if you could slow down a bit when giving an explanation and elaborate a bit more on why some things are done. People who just started learning these concepts would benefit from that approach, and I suspect more viewers of your channel are those who are trying to understand those topics and not just review them.
@atharv9924
@atharv9924 Жыл бұрын
Hi @ArjanCodes Could you please make video explaining builder pattern? I tried to understand from different sources and through UML found it very confusing.
@italobuitron1165
@italobuitron1165 Жыл бұрын
In MVC, the View inherits from Model, that's ok? I saw every have to be independet (view and model) an its the controller who binds both. For example, i using DASH for my apps. Can i use data from de model for make the view(html)? Or i have to pass the data as a @callback for do it (in this case, is the controller who say: theres a update for a view from the model) (sry for me engish)
@edgeeffect
@edgeeffect Жыл бұрын
I've not seen MVP before... I shall have to look into that some more - it might "calm down" my obsession with MVVM. MVVM really comes into it's own when creating web APIs. I've recently been working on an Android App... Nothing like working with the JVM to remind me that, like you.... I hate XML! ;)
@legitjimmyjaylight8409
@legitjimmyjaylight8409 Жыл бұрын
some frameworks enforce these, but other than that I think trying to enforce these over complicates things. I think SOC is the best, just simple separation of concerns, and you may find yourself doing some of these patterns accidentally when you simply do SOC.
@davidsylvestre928
@davidsylvestre928 Жыл бұрын
Is there any way to implement MUV from ELM architecture?
@DanielHaanpaa
@DanielHaanpaa Жыл бұрын
Awesome video, what about doing a video on model-view-update?
@ArjanCodes
@ArjanCodes Жыл бұрын
Noted!
@incremental_failure
@incremental_failure Жыл бұрын
Qt in Python is quite fantastic. Not everything is easy and there is some boilerplate but generally it's a breeze to work with and it's well written.
@lawrencedoliveiro9104
@lawrencedoliveiro9104 Жыл бұрын
It would be nice to make parts of the plumbing more declarative. For example, I share Arjan’s distaste for carrying around large amounts of XML. Why not define a Pythonic representation for that XML info? This is what I did in DBussy, my pure-Python wrapper for libdbus.
@djl3009
@djl3009 Жыл бұрын
@@lawrencedoliveiro9104 Thanks for sharing this. Shall take a look at your project at some point, it sounds very interesting. I've been "playing around" with DBus lately via Python bindings.
@nick_59
@nick_59 Жыл бұрын
@@lawrencedoliveiro9104 there is a way though. It is called pyuic. It should come with PyQt right away
@evanhowlett9873
@evanhowlett9873 Жыл бұрын
Did anyone else click on this thinking John Green started making videos about software architecture?
@bradleymaxted707
@bradleymaxted707 Жыл бұрын
Hi Arjan, Thanks for the video. I've been doing quite a bit of work using Pyside6 - the official Qt Library for Python. You can actually execute a script in Qt Designer to generate a Python file for the GUI - frees you from using the Ui File I've put together a quick MVVM example using Pyside6 in response to your video. What's the best way for me to pass you the Github Repo? Including it in the youtube comments results in the message being deleted.
@Sclafus
@Sclafus Жыл бұрын
I would like to add that PySide and PyQT are not the same thing. PyQT requires a license to be used for commercial products. PySide is LGPL, so you may use it for commercial products as long as you can provide the requirements of that license. Also using uic is pretty bad imho. Using a boilerplate is much better, since you can use the built-in functions of Qt to translate the UI files in a class representation. gmarull/pyside2-boilerplate is a nice starting point.
@marna_li
@marna_li Жыл бұрын
In MVVM, the ViewModel should not know about the View or any view technology. And you could write the bindings manually outside of the ViewModel instead. That is how you would do it in frameworks that lack built in data binding support.
@yeetdeets
@yeetdeets Жыл бұрын
IMO you should add "GUI" to the title as it is in the first sentence of the description.
@vikingthedude
@vikingthedude Жыл бұрын
it seems that most web client-server apps use a MVP architecture is that correct? The model = database, view = client, presenter = server
@ewerybody
@ewerybody Жыл бұрын
Well, I DO hate using uic like this though :D I think it does create pretty much the same code as if you let it write to a .py file JUST in memory. (your IDE never has the chance to get you code completion on the widgets) (or is there something that mangles that out of the xml?) However: This generated code probably also contains sth like "QMetaObject.connectSlotsByName(PARENT)" which DOES do automatic widget-signal-slot binding to accordingly name and "QtCoreSlot()" decorated methods.
@ewerybody
@ewerybody Жыл бұрын
20:42 I also hate XML but working with Qt Designer to make .ui files is nice! I never have to deal with XML! ever! 🤷 Did you write this manually?! D:
@PaulSebastianM
@PaulSebastianM Жыл бұрын
MVC is best when you don't need a view-model so it works best with both GUI and non-GUI (REST API etc.) MVVM works best when you need a view-model and a change notification system that automatically wires up the events neede to update the GUI. All in all, if you look at why these architectures were created, you will find their best fits. So, choose based on that.
@atanas-nikolov
@atanas-nikolov 10 ай бұрын
To be fair, I've always seen the traditional MVC pattern as a little bit too coupled, and have implemented MVP pretty much always, without calling it that. It gets tedious if you do a lot of component nesting though. Depending on how you set it up, it can be quite frustrating at times. Having to bind things 3-4 layers deep would require you to write pass forward functions and that bothers me for some reason. I feel like there should be a better way to do it, but there isn't really, if we want to keep things decoupled.
@movrew
@movrew Жыл бұрын
I always like each video before watching lol
@ArjanCodes
@ArjanCodes Жыл бұрын
Thanks! Unfortunately I can’t heart your comment before you post it, so I’ll keep doing it afterwards 😉.
@Cyberfoxxy
@Cyberfoxxy Жыл бұрын
Remember. If you're using MVVM everthing is going to be amazing. Is what juniors believe. Me included. Though i grew past it. Now i what the saying "All code is shit" is true. Because there is no right answer. Only compromises.
@chehsunliu
@chehsunliu Жыл бұрын
Do you have any plan for publishing some stuff on podcast?
@ArjanCodes
@ArjanCodes Жыл бұрын
Maybe in the future!
@img-dv4lr
@img-dv4lr 4 күн бұрын
i did a good recherche and i think you are wrong puting the update function in the views in the MVC part because it has to be in the controller.
@TheAmazingpower
@TheAmazingpower Жыл бұрын
Seeing PyQt being used raises the question if there is any way to get a proper type (hint) IDE support for class attributes, like delete_button or todo_edit object. Neither using inheritance from a py file created by PyQt, nor using the uic.loadUi will make the IDE recognize all existing attributes. I am asking this because I work a lot with huge PyQt apps initialized from UI files, and the IDE not knowing the objects and attributes makes writing code more prone to typos and other errors. Up to now, I did not find a good workaround, other than writing all PyQt code myself, which is not an option when using UI files being in the multiple (ten) thousands of lines long.
@Sclafus
@Sclafus Жыл бұрын
In pyside, you can use pyside-uic which converts the XML attributes to a class representation. I don't know if pyqt has the same interface, but it should. If you want to give it a go, I would suggest to start from gmarull/pyside2-boilerplate
@TheAmazingpower
@TheAmazingpower Жыл бұрын
@@Sclafus In PyQt, there is pyuic5/pyuic6 which kinda does the same, so converting to a Python class file. The class however does not got the attributes on init, but as a setupUi method, so the IDE does not provide name support or Auto completion during coding. I guess that’s the death you have to die using Qt files. It’s not that bad, but sometimes you may misspell a word.
@Batm189
@Batm189 Жыл бұрын
What do y'all think about the PySimpleGUI library?
@czarnick2
@czarnick2 Жыл бұрын
I used it in a project recently and I was very happy with it. Lots of "cookbook" examples on the site, and it was easy to get up and running. Apparently it can use tkinter or Qt, so that's pretty sweet - we used tkinter
@roPe_A
@roPe_A Жыл бұрын
Using MVC, you passed the view and model into the controller. On some websites I saw that they passed a controller and model into the view and model into the controlller. Are both approaches correcct? Or which one is the proper MVC? Thanks a lot.
@roPe_A
@roPe_A Жыл бұрын
@MacGuenther by "passing" I literally meant passing them as an argument for class initialisation (sorry I am a newbie in python). However, I believe your cases A) and B) described exactly what I was trying to say but in more civilised language. I use pyQt for my program. By user input actions in the VIEW, the CONTROLLER does "a computation" and modifiy the data inside the MODEL and then using signals and slots the MODEL directly send results into the view. To do that, my VIEW has to have access to the MODEL and CONTROLLER which corresponds to your case B) and my "passing model and controller as a parameter". Since I am still learning all of that, I am glad that my approach is not totally wrong. Thank you for your reply.
@roPe_A
@roPe_A Жыл бұрын
@MacGuenther Thanks, I am basically learning python by building a software representing hydrological simulation model which I am developing as well. The first version was a spaghetti mess but then I learned about design patterns and MVC. This channel helped me a lot by introducing to me dataclasses, protocols, abstract classes and other stuff.
@KnThSelf2ThSelfBTrue
@KnThSelf2ThSelfBTrue Жыл бұрын
I feel like this architecture has evolved into "Design System Component Library, Generated Backend API Client SDK, Frontend App or Microfrontend"
@mariocamspam72
@mariocamspam72 Жыл бұрын
What is your opinion on MVVMS?
@fat3d
@fat3d Жыл бұрын
What about MVT (Django)?
@eugenmalatov5470
@eugenmalatov5470 9 ай бұрын
Can I find the source code somewhere?
@vinny142
@vinny142 Жыл бұрын
I am so happy that "m not a developer anymore. The endless discussions about what's the best structure, from the pointless debates, the "but this is faster" and "but this is cleaner" poop to the "but doing it ourselves is more fun" nonsense. What has worked best for me in the end is : Use a framework. Check them all out, choose the one that makes most sense to you and use it. Yes there will be a hundred people who will tell you it's the worst framework in the world but those people exist for every framework so it's void. What you don't want to do is build your own stuff because you end up building a framework. Building a framework is a great way to learn the hard was exactly how difficult that is and how much you should not ever want do that unless it's a customer paying you endless amounts of money. Whatever framework you build will never be finished, every three months you will find a better way of doing things (either because you saw it in a framework somewhere or because your requirements changed) and you will have to re-write huge amounts of code to incorporate the changes. One thing that is of great importance is: whatever you chose to do: be consistent. Once you go MVC, try to make eveything MVC or split your code into application and libraries. Don't mix architectures because it will be the death of your project.
@nhanNguyen-wo8fy
@nhanNguyen-wo8fy 10 ай бұрын
5:45 10:20 12:16 14:00
@jackanderson9258
@jackanderson9258 Жыл бұрын
I love your content. Thank you for what you've taught me. A friendly advice though; please avoid politics (thumbnail).
@ArjanCodes
@ArjanCodes Жыл бұрын
Thank you!
@bardeebooboo
@bardeebooboo Жыл бұрын
How about MVI
@thomasnygards
@thomasnygards Жыл бұрын
Great video but you should not have included the database in the first comparison. It had nothing with the topic to do and just complicated the comparison with the all-in-one-file solution.
@markhathaway9456
@markhathaway9456 Жыл бұрын
It's very common, but more important for this video, it's a very handy thing to have a Model (what the programmer creates to represent the real world stuff). Then he can show how it is used next too the View and Controller.
@ArchonLicht
@ArchonLicht Жыл бұрын
Your model isn't a model but a DAO (data access object)
@tswdev
@tswdev Жыл бұрын
In 4K the text looks really bad. Something to do with youtube. In 1440p looks fine
@xToTaLBoReDoMx
@xToTaLBoReDoMx Жыл бұрын
Isn't this the guy from Fargo?
@avazart614
@avazart614 Жыл бұрын
I thought using "from __future__ import annotations" is a bad idea.
@peter62709
@peter62709 Жыл бұрын
Why would it be? I've never seen anything indicating it's bad, and the behavior it allows will become default in future Python versions.
@loic1665
@loic1665 Жыл бұрын
I don't think it's bad but you have to understand what you are doing. There is a good chance that this behavior will become part of a future release of python but there is also a risk that the behavior will change... I think mCoding did a video on __future__ which xas really interesting
@Webfra14
@Webfra14 Жыл бұрын
Software Architecture? You have time to think about Software Architecture??
@Kennethlumor
@Kennethlumor Жыл бұрын
Sir please how to import a module from (mvc) package into (mvvm) pack when you want to use it.
@Jeanpierrec19
@Jeanpierrec19 Жыл бұрын
SQL Commands in lower case? My eyes...
@stepander007
@stepander007 Жыл бұрын
So "keep DB simple" means do not using id that you have by default? What a simplification.
@ArjanCodes
@ArjanCodes Жыл бұрын
No. It means that it's not relevant for the example, since this video is not about databases.
@RoysIdea
@RoysIdea Жыл бұрын
Love the content, but would prefer a quiet keyboard.
@incremental_failure
@incremental_failure Жыл бұрын
Wondering if it's blue switches or red or brown.
@kodedart2311
@kodedart2311 Жыл бұрын
I use a modern asian architecture these days.
@_Stin_
@_Stin_ Жыл бұрын
For EVERY project?
@cappy2112
@cappy2112 Жыл бұрын
This is good, but in the MVP example, you have the Presenter class defined in two separate files. This doesn't make sense to me, and looks like a code smell. If you're using a class more than once, why is it not defined in 1 file and imported twice?
@ArjanCodes
@ArjanCodes Жыл бұрын
It’s defined in one file, but what I’m doing in the example is use a Protocol class to locally define the interface of what a presenter object should look like. So it’s not a code smell, but a way to provide abstraction between the different components of the architecture.
@Kennethlumor
@Kennethlumor Жыл бұрын
Sir please i make a video on how to import a module from a package into another pack. For example using this our tutorial because i can see you have root folder containing sub folders.
@_Stin_
@_Stin_ Жыл бұрын
There are as many ways to skin the proverbial cat as there are coders. Only advice I can give to anyone in software development is "know your languages." as in which is best and how to get the best from each one. Possibly also "the framework is a lie" given recent, immature philosophies in coding. One last thing I HAVE to say that renders all other lessons null and void - COMMENTS?? O_o
@bartvrhijn
@bartvrhijn Жыл бұрын
If you get tired of making a good pun for the likes, just skip it :D I will give a thumbs up anyway
@ArjanCodes
@ArjanCodes Жыл бұрын
Thanks for that!
@GarrethandPipa
@GarrethandPipa Жыл бұрын
all 3 are a design principle to abstract the business concerns of applications into logical units. My boots on the ground opinion after 44 years. There is more effort put into trying to absolve a programmer of accountability with design philosophy than writing good code. New programmers are just going to write shitty code because they are inexperienced. That's why you put them on small trivial things until they acquire that experience. Back to MVVM, MVP, MVC.... At the level that these 3 "things" become useful your not dealing with a few business systems but 25. It doesn't solve the complexity problem and at that point it really doesn't even provide organization. every single religious programming practice doesn't change the fact that shoe horning code into a mould doesn't solve problems but creates them. Sure you can google some trivial implementation but when you scale it up. Your left wondering how you did it wrong when you followed the best practices. Or you think it just feels wrong. Or experience tells you it is going to be cluster fuck down the road. You were sold promises not guarantees by guys selling books/conferences who are vested into their own success not yours. If the whole thing collapses... they still have your 50 bucks for the book and the 500 for the conference.
@ArchonLicht
@ArchonLicht Жыл бұрын
These aren't "architectures", these are patterns of architecture.
@Kennethlumor
@Kennethlumor Жыл бұрын
I'm using VISUAL STUDIO CODE. but if i import a module from one package into another i always get ModuleNotFounderror No module named
@thisisreallyme3130
@thisisreallyme3130 Жыл бұрын
I'm sure there's a simple answer (like: "python -m pip install Missing_module_name") but I suggest a a detour right now to learn `pyenv`. You will have to learn pyenv anyways (IMO) to get far at this. Ideally you create 1 .pyenv environment for every project/tutorial you work on.
@lawrencedoliveiro9104
@lawrencedoliveiro9104 Жыл бұрын
Microsoft Windows trouble?
@jataman123
@jataman123 10 ай бұрын
Your videos are great, but I downloaded the design guide and it must be a joke. It's not a guide. It's a couple of pages of your course advertisement ;)
@RaveYoda
@RaveYoda Жыл бұрын
Wait... this whole time what I thought was MVC is MVP?? >.> Okay... Huh.
@_Stin_
@_Stin_ Жыл бұрын
Swings and roundabouts - I try to focus on the solution as opposed to which collection of methodologies I can best shoehorn the solution into.
@ihateidiots9484
@ihateidiots9484 Жыл бұрын
Mvc, mvp, mvvm and others mv* are not architecture. They are design patterns
@ArjanCodes
@ArjanCodes Жыл бұрын
MVC etc are not design patterns, they are architectural patterns.
@dwhall256
@dwhall256 Жыл бұрын
XML is the worst dogma introduced in the software discipline in the last 20 years. It is neither human-friendly nor computer-friendly. It is ugly in a way that I never thought simple ASCII characters could be. It is overweight in its syntax and led to code editors becoming overweight with additional code-completion plug-ins.
@matswessling6600
@matswessling6600 Жыл бұрын
it is both human friendly and computer friendly. but it has a single flaw: comments cannot be nested.
@elultimopujilense
@elultimopujilense Жыл бұрын
Those are not architectures, those are presentation patterns.
@khangnguyen96
@khangnguyen96 Жыл бұрын
Could you please explain the differences between software architectures and presentation patterns ?
@elultimopujilense
@elultimopujilense Жыл бұрын
@@khangnguyen96 the presentation patterns live only in the "presentation" layer of an architecture, the application and business logic have nothing to do with those presentation patterns. I would strongly advice you to read the book Clean Architecture by Robert Martin. It will totally change the way you code.
@21Million
@21Million Жыл бұрын
Why bog yourself down with terms like MVC, MVP, or MVVM? Just use React or Angular and think in terms of microservices, templates, components, and services. Simplify instead of using 20-year old concepts.
@chudchadanstud
@chudchadanstud 5 ай бұрын
Please tell me you're joking
@Geza_Molnar_
@Geza_Molnar_ 5 ай бұрын
(I dare to provoke 🙂) Should we abandon CPUs, RAMs, monitors and some other stuff, too, 'cause those are also 20+ year old concepts?! What about milk and bread? ;-)
@Kennethlumor
@Kennethlumor Жыл бұрын
Sir please and please help me
@Matt-iy2cf
@Matt-iy2cf Жыл бұрын
The more I view this video the more I think you are just showing off. It is clear to me you have knowlegde of the topic but this is just about as much as I get from this video. It is rushed and feels like blubber jabber to someone who just discovered concept of mvc. I think I’d benefit more from studying this code itself rather then listening to your brief and confusing explanation. Please keep in mind that most people visiting your channel are just trying to learn and understand these topics. You don’t have to impress us with how fast you speak and type. Just present the material in a clear and digestible fashion. If this was a sofware design you would use “separation of concerns” to develop and make the best use of different part of the program. Why don’t you have the same approach when creating videos…?
@dmitrykim3096
@dmitrykim3096 10 ай бұрын
Pythons syntax is so ugly
@dannyjaye
@dannyjaye Жыл бұрын
Going by the thumbnail, if you dont even follow the simple business logic of what happened with Twitter, then I probably wouldnt trust you to advise on what software tools to use. 💁🏻‍♂️
@JohnKnellers
@JohnKnellers Ай бұрын
GFY. It i sas everybody knows is the best software architecture!
The Ultimate Guide to Writing Functions
24:31
ArjanCodes
Рет қаралды 178 М.
Protocols vs ABCs in Python - When to Use Which One?
15:31
ArjanCodes
Рет қаралды 33 М.
Incredible magic 🤯✨
00:53
America's Got Talent
Рет қаралды 70 МЛН
КАРМАНЧИК 2 СЕЗОН 7 СЕРИЯ ФИНАЛ
21:37
Inter Production
Рет қаралды 541 М.
"I Hate Agile!" | Allen Holub On Why He Thinks Agile And Scrum Are Broken
8:33
Top 5 Most Used Architecture Patterns
5:53
ByteByteGo
Рет қаралды 229 М.
What is programming MVC? [Detailed Explanation]
24:40
DevMarketer
Рет қаралды 414 М.
What Is MVC? Simple Explanation
10:40
Traversy Media
Рет қаралды 511 М.
15 Python Libraries You Should Know About
14:54
ArjanCodes
Рет қаралды 372 М.
A Deep Dive Into Iterators and Itertools in Python
21:01
ArjanCodes
Рет қаралды 60 М.
MVVM vs. MVI - Understand the Difference Once and for All
18:40
Philipp Lackner
Рет қаралды 33 М.
Exploring UI Design Patterns: MVC, MVP, and MVVM
9:02
Andrey Tech
Рет қаралды 1,7 М.