[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
RE: [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.
>
MIPlugin.getDefault().createCSession();
Those were helper function/methods, or rather factory methods to make things
easier when creating a session, since different environment have different
needs. You can create the Session yourself.
> [This change very slightly broke source compatibility(fixed).]
>
Agreed. It was deliberate. "-i mi" means different things on platform, it
was an attempt to make sure that the clients using those methods know what
miversion there gdb supports.
> 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).
createCSession() is on MIPlugin, it is not a specific instance but rather a
static/factory method.
> 2. pass in an xml file
Looks like overkill.
> 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).
>
I'm not conviced, but open to changes.