PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WEBDEV 2024 → Building a multi-customer application using Webdev
Building a multi-customer application using Webdev
Débuté par Gautam, 10 fév. 2017 09:56 - 4 réponses
Membre enregistré
67 messages
Posté le 10 février 2017 - 09:56
I am facing a particular challenge in terms of designing a webdev application and looking for ideas from the forum on best possible design methodology.

I have an insurance system developed in webdev that is currently being used by two separate customers. Both customers use the system primarily to provide motor cover-related insurance products.

Though the two customers provide the same kind of insurance cover, the way the premiums are calculated and the data that is stored for each customer is different as their product offerings are different. For example Customer 1 provides motor cover based on the number of vehicles insured, sum covered, engine capacity of the vehicles etc. Customer 2 uses the same fields as customer 1 but also requires the age of the primary drivers and does not require to know the number of vehicles insured.

If I was to market this product to other customers then I may find that their requirements may be slightly different to the first two and they may have their own specific products that behave differently.

I could build the entire logic for the all the customers in a single application but this presents numerous problems. For example every time a new field is added to the database or a new business rule is created to cater for a specific customer's requirements the analysis would have to be changed and updates would have to be provided to all of the customers though only one customer's requirements have changed.

Is there a way to externalize customer specifc "product definition" data and logic outside the core system so that I can provide customized products as required by each of my customer but keeping the core untouched?

A way of defining "dynamic forms with their own data validation and calculation rules" that could be passed back to the core system. This way when an individual customer's requirements change - I just have to change the analysis, forms and codes for that customer without affecting any of other customers.

Almost like calling a webdev application from another webdev application whilst being able to exchange data between them?

Any ideas on how to go about it?

Thanks and regards

Gautam
Posté le 10 février 2017 - 13:02
Hi Gautam,

this is how I manage this kind of situations :

I have a core application shared by everybody (there may be some options
at that level too, if needed)

For added FIELDS in the database for specific customer, I add their
definition in a parameter file (text memo based) and I add their value
as pair of Name=Value inside a text memo for each file where it's needed.

I use some standard code in every window where these fields can be used
to display them at the appropriate place (also defined in their properties).

As for the different business rules, calculation methods, and so on, I
use dynamic compilation and personalized procedures (using standard
fields or extended fields) also stored as text memos in my parameter
file. Which customer uses which procedure is also stored in the
customer's parameters, of course.

Best regards

--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

Ready for you: WXShowroom.com, WXReplication (open source) and now WXEDM
(open source)

More information on http://www.fabriceharari.com


Le 2/10/2017 à 3:56 AM, Gautam a écrit :
I am facing a particular challenge in terms of designing a webdev
application and looking for ideas from the forum on best possible design
methodology.

I have an insurance system developed in webdev that is currently being
used by two separate customers. Both customers use the system
primarily to provide motor cover-related insurance products.
Though the two customers provide the same kind of insurance cover, the
way the premiums are calculated and the data that is stored for each
customer is different as their product offerings are different. For
example Customer 1 provides motor cover based on the number of vehicles
insured, sum covered, engine capacity of the vehicles etc. Customer 2
uses the same fields as customer 1 but also requires the age of the
primary drivers and does not require to know the number of vehicles
insured.

If I was to market this product to other customers then I may find that
their requirements may be slightly different to the first two and they
may have their own specific products that behave differently.

I could build the entire logic for the all the customers in a single
application but this presents numerous problems. For example every time
a new field is added to the database or a new business rule is created
to cater for a specific customer's requirements the analysis would have
to be changed and updates would have to be provided to all of the
customers though only one customer's requirements have changed.

Is there a way to externalize customer specifc "product definition" data
and logic outside the core system so that I can provide customized
products as required by each of my customer but keeping the core untouched?

A way of defining "dynamic forms with their own data validation and
calculation rules" that could be passed back to the core system. This
way when an individual customer's requirements change - I just have to
change the analysis, forms and codes for that customer without affecting
any of other customers.

Almost like calling a webdev application from another webdev application
whilst being able to exchange data between them?

Any ideas on how to go about it?

Thanks and regards

Gautam
Membre enregistré
67 messages
Posté le 10 février 2017 - 16:00
Hi Fabrice

Thank you for your suggestion and feedback.

Please can you further explain:

"I use some standard code in every window where these fields can be used
to display them at the appropriate place (also defined in their properties)."

How do you generate a corresponding control (edit box, combo, checkbox etc) on a webdev page and specify where in the form it should be displayed?
How do you then read the content of the user input?
How do you reference the "control" in your dynamic code?

Does this not create a huge maintenance issues? How about creating reports on this user specific data?

Sometimes additional fields may required based on the input of the current field/value - how would we put logic to do this?

I was thinking along the lines of being able to create mini apps that could be called from the main/core application. For example you could define the entire customer specific forms and data in a separate webdev application and then call the relevant page from the main webdev application as and when required. Obviously the data exchange between the main application and the mini app would be structured and predefined.
You could then have several of these mini apps - one for each customer's specific requirements. That way you can utilize the full power of WX without having to write too much custom code. It becomes very easy to maintain the customer specific code too and any changes made are isolated and do not affect other customers.

Is there a way to do this in webdev? I was thinking of external components but that would require the external component to be included in the core application at design time and that would then defeat the objective.


Thanks and regards

Gautam
Posté le 10 février 2017 - 18:56
Hi,

How do you generate a corresponding control (edit box, combo, checkbox
etc) on a webdev page and specify where in the form it should be displayed?
How do you then read the content of the user input?
How do you reference the "control" in your dynamic code?


Now that controlCLone is available in webdev, that's what I'm using.
Before that, I had a bunch of invisible controls that I made visible
when needed.

Position is done using ..X and ..Y properties.
As for the user input, it's in regular control, so your code just needs
to know that edt_Text1 is for user defined field X, and so on.

Indirections are of course of a great help here.


Does this not create a huge maintenance issues? How about creating
reports on this user specific data?


Nothing specific for maintenance (in fact, it's simpler than modifying
the analysis, as the file structure doesn't change. You just need your
code to be able to handle what is used, and fail gracefully when it's
not there.

Reports are done the same way than pages (controlClone) -OR- (for before
controlclone existed in reports), by using iPrintText directly.

In fact, for some application, you can end up creating a
page/window/report editor, and do evertyhing after that by code (my
first version of that tool was made in BAL for Prologue in 1985).

Sometimes additional fields may required based on the input of the
current field/value - how would we put logic to do this?


If value is this, then displaynewFile(Y)... I don't see what the problem is.

I was thinking along the lines of being able to create mini apps that
could be called from the main/core application. For example you could
define the entire customer specific forms and data in a separate webdev
application and then call the relevant page from the main webdev
application as and when required. Obviously the data exchange between
the main application and the mini app would be structured and predefined.
You could then have several of these mini apps - one for each customer's
specific requirements. That way you can utilize the full power of WX
without having to write too much custom code. It becomes very easy to
maintain the customer specific code too and any changes made are
isolated and do not affect other customers.


With my technique, you code the whole thing ONCE and then you can
customize every thing without changing a line of code.

With yours, every single thing is specific to a customer and needs to be
rewritten each time. It's a completely different philosophy.

Now your description does not include how ou are going to store data,
but from the sound of it, it looks like a separate analysis, with
separate data files, and the whole complexity of using 2 in a project
and exchanging data.


Is there a way to do this in webdev? I was thinking of external
components but that would require the external component to be included
in the core application at design time and that would then defeat the
objective.

There probably is, but I do not like that approach at all, as for me
it's even more complex than having one version of your app per customer.
Now you have one per customer PLUS the main one and all that needs to
communicate, files needs to be updated, and so on.

Your solution seems to be the ultimate specific code, while mine is
going the generic way.

Best regards

--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

Ready for you: WXShowroom.com, WXReplication (open source) and now WXEDM
(open source)

More information on http://www.fabriceharari.com


Thanks and regards

Gautam
Membre enregistré
17 messages
Popularité : +1 (1 vote)
Posté le 16 février 2017 - 13:49
Hi Gautam,

Some differences in calculations may be solved by dynamic compilation.
In one application for client specific calculations I use a file with a memo field containing functions in Wlanguage. (which I call "formulas" for the end-user)
In my case these formulas can even be created or modified by the clients themselves.
In these formulas there are some standard variables used by the function.
You can substitute these variables with their values at runtime and use the compile function to get the result.
That way you can have client specific calculations, by letting them choose the proper function.
So one client can use a function like:

Amount is currency
SWITCH Number_of_Vehicles
CASE 1 to 20
Amount=InsuranceRate
CASE 21 to 40
Amount=InsuranceRate*0.95
END
RESULT Amount

In code you do a replace Number_of_Vehicles and InsuranceRate from a database field and then compile the function and get the resulting Amount.
This is only useful if there are not too many differences in the used variables.
I have no speed issues using this technique.

Regards,
Piet