[kforge-dev] naming for events/event handlers

John Bywater john.bywater at appropriatesoftwarefoundation.org
Mon Sep 19 11:43:13 UTC 2005


Rufus Pollock wrote:

> Kforge uses a centralized event notification system driven of 
> kforge.plugin.PluginController. John who designed the system intends 
> to post more about this to the list soon but in the mean time i wanted 
> to raise the issue naming for method event handlers (which in turn is 
> naming for events themselves). For example currently we have:
>
>   onNewService
>   onDeleteService
>
> 1. would it better to have  'create' rather than 'new' (note we also 
> have things like onNewProject, onApproveProject, onDeleteProject)


I prefer 'create' rather than 'new'....

>
> 2. Should we have (as currently)
>
>   on<DomainObject><Action>
>
> or
>
>   on<Action><DomainObject>


The former would be consistent with the commands (e.g. onProjectCreate). 
But we currently have the later (e.g. 'onNewProject'). I would prefer 
onProjectCreate.

>
> 3. should we have more temporal qualifiers such as 'after' and 'before'


I'm not sure if this is would add value, at least at the moment. But the 
on<DomainObject>Create event is raised /after/ the domain object has 
been created, and the on<DomainObject>Delete event is raised /before/ 
the domain object is deleted. There should perhaps also be an 
on<DomainObject>Update event, which would be raised /after/ attributes 
of the domain object have been changed.

John.

>
> ~rufus
>





More information about the kforge-dev mailing list