Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-debug-dev] createCSession()

The method signature of createCSession() changed to include the MI
version and this prompted me to think a bit about methods that  have
varied and numerous arguments. CDT seems to have a fair number of such
lengthy and varied arguments lists.

[This change very slightly broke source compatibility(fixed).]

Some alternative to having lots of arguments that come to mind:

1. the createCSession() could have no arguments. The created object
   could have various setFoo() methods. If these methods where not
   invoked then some reasonable default could be used(or a runtime
   exception of if no default is possible).
2. pass in an xml file
3. define a "settings interface" which has a base class that the caller
   can subclass to change default behaviour. This could be combined
   with an "inversion of control" of #1. createCSession(void) +
   settingsObject.apply(session).


-- 
Øyvind Harboe
http://www.zylin.com



Back to the top