How do you design your software architectures?

Everything else that doesn't fall into one of the other PB categories.
User avatar
X0r
Enthusiast
Enthusiast
Posts: 138
Joined: Tue May 01, 2007 3:49 am
Location: Germany

How do you design your software architectures?

Post by X0r »

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.
percy_b
User
User
Posts: 72
Joined: Mon Jan 12, 2015 10:25 am

Re: How do you design your software architectures?

Post by percy_b »

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 MVC, you're usually working with a framework of some sort such as C# + .Net or PHP + CodeIgniter.

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
User avatar
X0r
Enthusiast
Enthusiast
Posts: 138
Joined: Tue May 01, 2007 3:49 am
Location: Germany

Re: How do you design your software architectures?

Post by X0r »

With MVC, you're usually working with a framework of some sort such as C# + .Net or PHP + CodeIgniter.
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.

What I am currently looking for are concepts to realize solid architectures large GUI-applications in PureBasic can be built upon.
User avatar
mk-soft
Always Here
Always Here
Posts: 5409
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: How do you design your software architectures?

Post by mk-soft »

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)
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
User avatar
oreopa
Enthusiast
Enthusiast
Posts: 281
Joined: Sat Jun 24, 2006 3:29 am
Location: Edinburgh, Scotland.

Re: How do you design your software architectures?

Post by oreopa »

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
Marc56us
Addict
Addict
Posts: 1479
Joined: Sat Feb 08, 2014 3:26 pm

Re: How do you design your software architectures?

Post by Marc56us »

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.

:)
User avatar
mk-soft
Always Here
Always Here
Posts: 5409
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: How do you design your software architectures?

Post by mk-soft »

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. :wink:

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
User avatar
X0r
Enthusiast
Enthusiast
Posts: 138
Joined: Tue May 01, 2007 3:49 am
Location: Germany

Re: How do you design your software architectures?

Post by X0r »

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.
User avatar
the.weavster
Addict
Addict
Posts: 1537
Joined: Thu Jul 03, 2003 6:53 pm
Location: England

Re: How do you design your software architectures?

Post by the.weavster »

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.
Post Reply