Hey folks,
during my studies I often used the Model-View-Controller (MVC) and Model-View-Presenter (MVP) architectural patterns in C++ and C# when developing applications with graphical user interfaces for scientific purposes. These patterns helped me a lot in developing larger projects and to dive deeper into software engineering.
I am now about to start a large project in PB and have been thinking a lot about how to design the software architecture. Since both MVC and MVP are designed to be implemented using OOP and PB does not natively support this paradigm, I would like to know which patterns you are using for applications with a GUI and what experiences you made implementing them with the PB GUI lib.
How do you design your software architectures?
Re: How do you design your software architectures?
With MVC, you're usually working with a framework of some sort such as C# + .Net or PHP + CodeIgniter.X0r wrote:Hey folks,
during my studies I often used the Model-View-Controller (MVC) and Model-View-Presenter (MVP) architectural patterns in C++ and C# when developing applications with graphical user interfaces for scientific purposes. These patterns helped me a lot in developing larger projects and to dive deeper into software engineering.
I am now about to start a large project in PB and have been thinking a lot about how to design the software architecture. Since both MVC and MVP are designed to be implemented using OOP and PB does not natively support this paradigm, I would like to know which patterns you are using for applications with a GUI and what experiences you made implementing them with the PB GUI lib.
With PureBasic, you're often creating your GUI functionality via calls to the API of the underlying OS. I don't know if anyone has created a framework for PB. Maybe someone else can answer that question.
Sent from my LM-Q710.FG using Tapatalk
Re: How do you design your software architectures?
Yep. Concerning C#, I used WinForms and implemented an MVP architecture in my thesis. However, I felt like that WinForms was not designed for MVP, since the controls are self-managing their data in a way (as in PureBasic). A pure MVP architecture would require the view layer to have no information about the data it is displaying.With MVC, you're usually working with a framework of some sort such as C# + .Net or PHP + CodeIgniter.
What I am currently looking for are concepts to realize solid architectures large GUI-applications in PureBasic can be built upon.
Re: How do you design your software architectures?
If I understood this correctly you are looking for something like a "RAD" Rapid Application Development, which creates and manages automated with many windows and gadget.
Unfortunately Purebasic lacks something like this integrated for projects with many windows.
But it works with the FormDesigner and a tool I developed and use myself.
Look for the EventDesigner V3 (signature)
Unfortunately Purebasic lacks something like this integrated for projects with many windows.
But it works with the FormDesigner and a tool I developed and use myself.
Look for the EventDesigner V3 (signature)
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Re: How do you design your software architectures?
Perosnally I think hand coding GUI, even a fairly complex one, with multiple windows etc is not all that much more a laborious process than using a VD - especially if you make some small tools to help the process. YMMV. It also comes with the added bonus of not being "tied" to some other persons view of how events should be handled...
Proud supporter of PB! * Musician * C64/6502 Freak
Re: How do you design your software architectures?
Personally I do all my projects using a GUI with the Form Designer, even when there is only one simple window.
With the habit I've come to know how to work around its few rare bugs.
My biggest project has 23 .pbf files and I have no problem to manage all this with a simple method: I name all objects in a window with the same prefix. For example, a window that manages zip files will have gadgets like: Zip_Win, Zip_Win_Title, Zip_Editor, Zip_Btn_Quit etc.
So no problem to manage all this in the main loop and to know from which Form the gadgets come from.
I'm a self-taught computer scientist: I was never told that I needed a scientific method to make a program (There were no computer classes when I was in school...), so I did what I could, and so far it's one of the few areas where I've been able to make everything I needed work.
My dream too is an RAD for PB.
With the habit I've come to know how to work around its few rare bugs.
My biggest project has 23 .pbf files and I have no problem to manage all this with a simple method: I name all objects in a window with the same prefix. For example, a window that manages zip files will have gadgets like: Zip_Win, Zip_Win_Title, Zip_Editor, Zip_Btn_Quit etc.
So no problem to manage all this in the main loop and to know from which Form the gadgets come from.
I'm a self-taught computer scientist: I was never told that I needed a scientific method to make a program (There were no computer classes when I was in school...), so I did what I could, and so far it's one of the few areas where I've been able to make everything I needed work.
My dream too is an RAD for PB.
Re: How do you design your software architectures?
This is exactly how my EventDesigner works. Only that I don't have to write the prefix in FormDesigner myself, only that I have to give the window constant the correct different name.
The error correction and setting the prefix of the PDF file into a common PBF file (original PBF files are not changed). The creation of the event procedures, the event management via virtual tables is done by EventDesigner.
So a "RAD" for Purebasic.
But as already written, everyone has his own idea how the Event Management should look like.
Only the FormDesigner of Purebasic would have to be maintained better.
The error correction and setting the prefix of the PDF file into a common PBF file (original PBF files are not changed). The creation of the event procedures, the event management via virtual tables is done by EventDesigner.
So a "RAD" for Purebasic.
But as already written, everyone has his own idea how the Event Management should look like.
Only the FormDesigner of Purebasic would have to be maintained better.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Re: How do you design your software architectures?
Thank you very much for your thoughts and your input regarding this topic. I am not a computer scientist either, but over the years and with some larger projects I had been working on the need for proper concepts about structuring/managing codes for GUI applications has grown. Back in 2009, I started using different OOP precompilers in order to develop object-oriented software architectures where each form/window together with its events was represented by its own class. That really helped me a lot to create code with higher maintainability. However, I stopped using these tools as they were quite buggy and - apart from this - the development was abandoned. So I switched back to the native procedural paradigm in PB and I am somehow not happy with that. Writing OOP code without any precompiler is an option, no doubt. But it impacts the readability/maintainbility due to the code overhead.
I will now take a closer look at mk-softs concepts/tools, but would still be very happy to get more input regarding this topic.
I will now take a closer look at mk-softs concepts/tools, but would still be very happy to get more input regarding this topic.
- the.weavster
- Addict
- Posts: 1537
- Joined: Thu Jul 03, 2003 6:53 pm
- Location: England
Re: How do you design your software architectures?
I don't know if you've ever tried Qooxdoo but the norm there is to get your UI to trigger custom events with data attached and your application logic has listeners for those events. The idea is you can have a different UI for Desktop / Tablet / Smartphone, each UI just needs to trigger the appropriate events and pass the relevant data.
If you want to separate the UI from your application logic in PB this is something that could be replicated using PostEvent() and utilizing the data parameter to pass a JSON object containing the applicable data.
If you want to separate the UI from your application logic in PB this is something that could be replicated using PostEvent() and utilizing the data parameter to pass a JSON object containing the applicable data.