Jump to content

best approach to create a assistant/wizard unigui app


Jean-Marc Kiener

Recommended Posts

I have to create an assistant/wizard who take the user step by step (ca. 5 steps) through some forms (<<Back - next>>) to make an order. What is the best approach to achieve this?

  1. Put all on one form and work with a PageControl?
    Does this not results in hard to maintable code? Because it tends you to have all components, form logic and other buisness code in one form unit. You must have a large amount of self discipline to write clean code. Mostly i tends to “If then else..” orgy in event methods.

  2. Work with one Mainform and frames.?
    That's better because you can write code for each frame. In this project the mainform is just for showing the frames. Alle frames are inherited by one frame to share some design.

  3. Work with different forms?
    If you have to do a hybrid app that is the way you must go. You can achieve a Model-View-Controller pattern. It is the highest degree of separating form code from a form, because you have to make always two visible forms (one with unigui desktop and one with unigui mobile). So the code for steering the forms should be separated from the visible forms because you do not want it write twice. Since we decided not to go with a hybrid app, this approach is not necessary. But it is an nice and clear approach.

  4. Another approach?

I try to find out how to organize my code so i have a clear approach but not that much overhead.

  • Like 1
Link to comment
Share on other sites

Hello Jean Marc,

i really like this kind of topics.

Never again coding with spaghetti code ! That is the resolution for a good developer.

in major of unigui project, i am using your solution N°2 :

- minimum code on each Frame

- maximum code on a Class

The class will have all necessary methods. This approach gives much clear code, easyer to maintain and valuable for hybrid project (Desktop and Mobile).

Regards

  • Like 2
Link to comment
Share on other sites

9 hours ago, Abaksoft said:

in major of unigui project, i am using your solution N°2 :

- minimum code on each Frame

- maximum code on a Class

The class will have all necessary methods. This approach gives much clear code, easyer to maintain and valuable for hybrid project (Desktop and Mobile).

I don't want to hijack your thread and change the subject but can we use Frames for mobile development? After seeing the difference in layout properties of desktop and mobile versions, I completely dismissed using frames for such cases under mobile.

  • Like 1
Link to comment
Share on other sites

Hello, I have used approach 2, but moved to 3.

I'm using forms but embedded inside panel as it a frame, I only use frames for static data that will be shared across many forms.

Forms has much more features and events, for example I use OnShow event to prepare some data

  • Like 2
Link to comment
Share on other sites

Hello , I have used the first Approach in 2 wizards , it is working fine with organizing each step code in {$REGION}, but I don't recommend it.

in another wizard I mix between 1 and 3 (Especially good if you going to use existing forms and use them inside taps) 

I think you will be better off with no 3 it will be more manageable like Mohamed Nasman said

regards

  • Like 1
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...