E
EventListener
I need to drag a <div> around and drop it. The onDrop method then needs
to get some extra information about what to do.
I see two ways of adding this information
1. Creating a wrapper class for the div.
2. Adding the custom information as a property of the div itself.
I am wondering about the pros and cons of these ways -- both for
efficiency and style. Number 1 seems like it is code heavy - making
another Object, yet another layer of contex. But Number 2 seems like it
violates OO principles - a div and my custom information have nothing
to do with each other.
Any thoughts?
Cathy
to get some extra information about what to do.
I see two ways of adding this information
1. Creating a wrapper class for the div.
2. Adding the custom information as a property of the div itself.
I am wondering about the pros and cons of these ways -- both for
efficiency and style. Number 1 seems like it is code heavy - making
another Object, yet another layer of contex. But Number 2 seems like it
violates OO principles - a div and my custom information have nothing
to do with each other.
Any thoughts?
Cathy