In my Flex app, I use one remote object and multiple destinations. Is that a bad idea? It seems to be working just fine except for the one or two fringe cases:
- It's bad design, but we use the same method name on two different destinations and they seem to conflict when they're called at the same time.
- Logging errors show a method assigned to one destination as being associated with another.
As you've guessed. This is bad design for a multitude of reasons:
My suggestion would be to wrap two remote objects into a single parent object. You can pass this single object/class around and still have access to both destinations.
OR
If you're anticipating adding multiple features, create a singleton class with methods for handling remoting logic. This will keep Remoting access consistent across your application and leaves the destination logic contained in one place.