In my Robotlegs app service results often have to be persisted in models. This creates event pairs that have identical payload types:
- to carry the data from service to command,
- to carry the data from model to mediator
I'm wondering how to name these events. Imagine I have a service:
FooService.getProducts()
Then I have a model:
BarModel.setProducts()
BarModel.getProducts()
What is the best way to name the event dispatched by the service after it retrieves the product collection?
What is the best way to name the event dispatched by the model after BarModel.setProducts()
has been invoked?
Or maybe I should use a single event with two different types:
public class ProductEvent extends Event
{
public const SERVICE_PRODUCT_CHANGE:String = 'serviceProductChange';
public const MODEL_PRODUCT_CHANGE:String = 'modelProductChange';
...