When developing Flex applications in Adobe Cairngorm it is quite common to define all event constants as follows:
public static const LOGIN_EVENT:String = "LoginEvent";
The problem with this design is that there is no way of guaranteeing the event type will not collide with an Event type in another package.
Now, I think it is only fair to say that in a good design there typically would not be two Events with the exact same name. However, when developing large scale Flex applications in which additional modules are added with each major release, not to mention the fact that there can be literally hundreds and hundreds of classes, the chances of creating an Event with the same name begins to increase.
As a best practice you should assign the Event type a value which is identical to the Event’s fully qualified class path. This will ensure there can never be a collision of Event types. An example can be seen in the following:
public class LoginEvent extends CairngormEvent
public static const LOGIN_EVENT:String="com.domain.events.LoginEvent";
public function LoginEvent()
super ( LOGIN_EVENT );
It’s always better to be safe than sorry.