On Tue, May 19, 2009 at 3:50 PM, Dan Wilson <[email protected]> wrote:
> I want to start a thread about Default Event Types.
> Event Types, as you know are a ModelGlue:3 feature for defining behavior
> under an Event Type and assigning those Event Types to your Event Handlers.
> (lost? Read
> here: http://docs.model-glue.com/wiki/HowTos/HowToUseTypedEvents#HowToUseTypedEvents
> )
> A discussion came up in the  MG BOF at CFObjective about a default event
> type. Presently there is no such functionality and some members of the
> audience felt it was a good idea, though there has yet to be a consensus on
> how it works.
> Let's start the discussion with the following two questions.
> 1) Should there be a Default Event Type?
>

Yes, but it should be optional (in case that isn't obvious), meaning
that a developer doesn't have to specify a default event type.

> 2) Model-Glue 3 allows for an event handler to have multiple event types.
> This means the Default Event Type should technically stay with the
> Event-Handler regardless if the Event-Handler has other Event Types. If this
> is the case, how does a Default Event Type differ from adding logic to
> OnRequestStart?  If not, and the Default Event Type vanishes if a specific
> type is set for a specific Event Handler, what would the usage be?
>

I think that the default event type should vanish if one or more types
is specified for the event-handler. To me that's what default means:
use this if I'm not overridden. One should be able to specify multiple
event types as the default event type, just as one can specify
multiple event types on an event-handler. In order to allow a
developer to specify *no* event types for a particular event-handler,
they could specify type="" in the <event-handler> element.  In terms
of how to implement it in the xml, I can see a couple of options:

1. Make it a Model-Glue configuration setting, for example
"DefaultEventTypes", and allow a comma delimited list of event types.

2. Allow for a <default-event-types> element inside the <event-types>
element.  For example:

<event-types>
     <default-event-types="TemplatedEvent,SecuredEvent" />
     <event-type name="TemplatedEvent">
        <after>
            <views>
                <include name="main" template="templates/main.cfm" />
            </views>
        </after>
    </event-type>
    <event-type name="SecuredEvent">
        <before>
            <broadcasts>
                <message name=”LoginRequired” />
            </broadcasts>
            <results>
                <result name=”NotLoggedIn” do=”user.login” />
            </results>
       </before>
    </event-type>
</event-types>

>
> The Model-Glue mailing list is full of very smart people, so let's get the
> initial ideas out there and we'll work on refining them as we go along.
>
>
> Your input appreciated.
> DW

-- 
Bob Silverberg
www.silverwareconsulting.com

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "model-glue" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/model-glue?hl=en

For more about Model-Glue, check http://www.model-glue.com .
-~----------~----~----~----~------~----~------~--~---

Reply via email to