Talk:Any Type of Expense

From RadiusWiki

Hello Radius,

concerning Any Expense Type I would have some proposal - what about to do this thing modular?

Advantage for users? - Potentially huge :-O

How much additional coding time for Radius? - Not so much... :-) - Let others do it


What do I mean? - make RadiusCar open for plugins - make some list of possible "Any Expense Types" - in the list you can specify plugin that will handle this expense type - default expense type plugin is empty - no advanced calculation - if plugin is selected, you can receive more advanced results of calculation

How to do it? - Some public plugin interface would be defined (help, configure, insert_expense, get_km_costs, get_time_costs, get_distance_costs, load_plugin, unload_plugin, import_data, export_data, ???) -> other developers can write plugins with new functions - Plugin would allow to insert more advanced expense data (through interface function insert_expense) - Plugin would allow to get more advanced calculation of "Any Expense Types" (through interface functions get_km_costs, get_time_costs, get_distance_costs) - Plugin takes care of its own data (stores its private data, can import and export through interface functions import_data, export_data - potentially could be done in plugin config) - When plugin would be selected in expense type, you can run plugin's configuration (through interface function configure) - In total calculations, user could checkbox what types of "Any Expense" he wants, then through plugin interface selected function would be called and would report numbers (get_km_costs, get_time_costs, get_distance_costs) - plugin would have access to all internal data of RadiusCar (pumping, distances, preferences, ...) to be able go do "the best calculation his way"


Maybe I am too futuristic, but to me development of this plugin interface doesn't sound as the most difficult issue in RadiusCar development. If implemented, I believe this would greatly improve potential value to users. Tool wouldn't be closed to some predefined functionality, but it would allow much more without your coding through these plugins (as plugins could be programmed by anyone).

What types of plugins could be implemented? It was already discussed: - oil costs - insurance - highway toll - ...


OK... Enough. I have seen that you have written paragraph "Mission Impossible". Does this idea sound realistic or is it still that Mission Impossible? Might be it's just my optimism (and lack of knowledge) that makes me believe that this is possible and it's not so difficult... ;-)

Johny


Radius:

Welcome buddy! I'm glad to read you here too ;-)

The worst thing I have to say is that everything is possible. RadiusCar could allow many interesting features RadiusFuel never knew about. I like your interface idea and I will think about it. As you probably expect, the interface definition requires some additional effort thus it's not so simple as direct hard-coded programming. It seems to me like training on programming techniques. Aren't you a high-school teacher, are you? ;-)

To be honest, I think the first version of RC will be surely plugin-free because of the effort, but I am not absolutely sure. Maybe after a deep inspection I will realize plugins are handy for me too. The biggest disadvantage I see is extra memory consumption. I wanted to see RC as so called KISS (keep it small and stable). The very actual version of RC I have now takes about 45kB only on a PDA's "hard disk". Plugins would require additional space and more files to maintain.

Conclusion? I will think about it, but I cannot say if it's mission impossible now or not. If I define the interface, it should be COM I think.



Johny:

Radius,

I don't have anything against KISS approach and I believe it is good approach. 1. Plugins don't have to be there - no space used (if user doesn't want to use them) 2. I don't believe plugins have to be space consuming. I even don't think it has to be COM modules. It can be just ordinary DLL files. Interface could be defined as C .H file. If you define DLL export functions with parameters that's all you need. You can load needed DLL's and call it's functions' by name from program. I have seen this idea working in IR PC control software Girder (was girder.nl), where program was closed source with definition of interface and example empty c++/delphi plugin (normal DLL file). External developers did amazing job in creation of additional plugins.

Johny

P.S.: I'am not high-school teacher, I'm just fan of programming and like to find easy solutions for complex problems (I don't succeed everytime) ;-)