Re: Supporting multiple clients with different calculations -- using memo field for varying customer logic??

Author: mbsoftwaresolutions@mbsoftwaresolutions.com

Posted: 2015-11-18 at 11:54:02

This is EXACTLY what I was wanting. Thanks!!!! While it's nice to put

code in a table memo field so as to get the changes to the customer

easily, that creates a challenge for source code control. My app's exe

version would not change if Customer A's calculation logic changes

(since this is not bundled in the EXE), so my updating routine (which

checks for AppVersion in my Inno setup exe versus the version of your

VFP EXE) would not know the update is needed. Likewise, if you have

multiple installations (on each user's desktop), the challenge

magnifies. To that end, the "store the PRG/FXP in the client's Memo

field in your Companies lookup table and use that for each run of the

EXE" sounds like an appealing route to go, even with the concerns for

source control.

tia,

--Mike

On 2015-11-18 05:26, Alan Bourke wrote:

> To my mind you are looking at a sort of abstract factory pattern.

>

> You have:

>

> Jones_Total = (Cost * Tax%) + Overhead (% added) on that subtotal +

> markup

> Smith_Total = (Cost + Overhead% + Markup) + Tax%

>

> So for Jones have a PRG with a function Calculate(cost, tax, overhead,

> markup) which calculates it his way, and similarly a PRG for Smith with

> a function Calculate(cost, tax, overhead, markup) which calculates it

> the Smith way.

>

> Just supply the relevant compiled FXP to the relevant customer (or even

> all of them to all customers). Then in your application configuration

> DBF or wherever you just store the name of the FXP to use.

>

> CostCalc = "jones.fxp"

>

> In your application startup:

>

> set procedure to (CostCalc) additive

>

> Then you just call Calculate() with your parameters. It will run the

> Calculate() function in whichever FXP you pointed at.

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox

OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/6ce6f34fe12c86adf6f09a879ad81a27@mbsoftwaresolutions.com

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2015 mbsoftwaresolutions@mbsoftwaresolutions.com