Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[udig-devel] Re: fun on trunk: socket plugin does what? and draw2drenderer update

Okay Jesse your arguments about listeners and so on are making Handlers not look like the best option (looks to be very tied into user interface concerns). While I feel I am going to have to force Commands into everyone's life sooner in the development learning curve rather than later it feels like commands and/or handlers do not fit the bill.

One final idea/warning - what you are setting up here has the danger of growing. I am wishing for a nice separation between blocks of functionality that we could start to script / and or invoke remotely / invoke from a ui. The JGrass project seems to have a separation between there console and their user interface already. I suspect it is done in a similar manner to what you are setting up now.

Jody

Jesse Eichar wrote:
I also thought about using the handler. It is not bad but it has no "can handle" method. So you basically have to try it and check if it handled the message... I guess that is ok. I can move the iteration through all handlers into the SafeRunnable and keep trying until I get one.

The problem now is that IHandlers have state (listeners at minimum) and some subclasses actually make it explicit and therefore is not good for multi-threaded programming. We would be tempting implementers to create stateful Handlers which is a terrible idea for this application. Also as a parameter you get a ExecutionEvent as the parameter which has a Map as the parameters so the developer cannot use code completion easily to see what the parameter will be.

None of these issues kill the idea it just is not a nice API to learn.

Addressing the point we are making developers learn 2 APIs. That is absolutely true... However the counter argument to that is that they may not need to learn commands for a long long time. I still haven't for example and commands have been around as long as I have (4 years now). So having to learn commands is not a forgone conclusion.

Jesse



Back to the top