Timeline for Proper design for a class with one method that can vary between customers
Current License: CC BY-SA 3.0
5 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jan 3, 2017 at 22:04 | comment | added | FrustratedWithFormsDesigner | @Andrew: You might be able to write your formulas in a properties file, but then you'd need some sort of expression parser. And you may one day run into a formula that is too complex to (easily) write as a one-line expression in a properties file. If you really want non-programmers to be able to work on these, you'll need some sort of user-friendly expression editor for them to use which will generate code for your application. This can be done (I've seen it), but it's not trivial. | |
| Dec 30, 2016 at 19:26 | comment | added | Andrew | @Kat Thank you, if you read my edited question that's actually how I'm doing it. The drawback is that a developer has to create a new class which limits scalability -- I'd prefer a support person could just edit a properties file but I think there's too much complexity. | |
| Dec 30, 2016 at 17:44 | comment | added | Kat | @Andrew, One way a plugin can work is to use reflection to load in a class by name. The config file would list the names of classes for customers. Of course, you'd have to have some way to identify which plugin is for which customer (eg, by its name or some metadata stored somewhere). | |
| Dec 22, 2016 at 19:47 | comment | added | Andrew | Thanks. How would a plug-in work in say a Java environment? For example, I want to write the formula "result = if (Payment.id.startsWith("R")) ? Payment.percentage * Payment.total : Payment.otherValue" save that as a property for the customer, and insert it in the appropriate method? | |
| Dec 21, 2016 at 21:59 | history | answered | FrustratedWithFormsDesigner | CC BY-SA 3.0 |