Python Forum

Full Version: Messenger Library for MVC-like Patterns
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm new to Python, and while I've done a fair bit of programming in general, the bulk has been highly unstructured and almost entirely for my own purposes. I'm doing a small application that has a few calculations, but the bulk of the coding is user interaction and presentation of data. Code reuse is not a primary goal of what I'm doing right now, but I know having the ability to reuse or repackage code in the future would be very useful.

I came across this thread, but it didn't offer any discussion: https://python-forum.io/Thread-WxPython-...VC-pattern

What messaging libraries are Python coders using for desktop application development where they are implementing an architectural pattern like MVC, MVP, etc.? Are you building your own? Using PyPubSub (https://github.com/schollii/pypubsub and https://pypi.org/project/PyPubSub/)? Using a larger framework?

I don't think I have the skills or experience to do my own, but I'm also not looking for a lot of features at the moment. The GitHub link above looks to be last updated maybe 2 years ago, with minor updates since then. Can I build on top of this with the understanding that there are likely no major bugs? PyPubSub doesn't appear to be HUGELY popular (stars and forks are relatively low) but it does seem to have somewhat of a presence on both GitHub and PyPi.

I'm open to suggestions or ideas!
I'm not sure you need a library for it. The model/view/controller are just classes.

That said, I have zero experience using mvc for gui applications, only for websites. And in that context, Django has that support built in, as does Asp.net.

Is there something you currently use in another language that you're trying to get similar functionality out of with python?
(Nov-05-2018, 04:34 PM)nilamo Wrote: [ -> ]I'm not sure you need a library for it. The model/view/controller are just classes.

*snip*

Is there something you currently use in another language that you're trying to get similar functionality out of with python?

Thanks for the reply. I'm not referring to the MVC classes themselves, rather whatever method is implemented for communicating between the classes to limit coupling (notifications, subscriptions, etc.).

Now that I think of it, for a similar project I was trying to do something MVVM related in C#, and using MVVM-light or another framework I don't recall. They had notifications or messages which I guess is what I'm trying to replicate in a sense. This is my first time really trying hard to implement something that is more maintainable and shareable as I'd like to post the project on GitHub once I feel a reasonable base has been laid down.

*edit*
Right now I have about 1000 lines of code, and it is already a mess to make updates to various bits of code since I was just doing things "as needed" to help define what I want the application to look like. Now I'm starting from line 0 again, and I would like to treat this as a learning opportunity for how to develop maintainable code.