4 Replies Latest reply on Feb 21, 2010 10:36 AM by NickDF__

    Bindable Variables Vs Custom Events

    NickDF__ Level 1

      Greetings to all...

       

      I'm working on an application which is too big so whenever we can we are creating custom components and classes to organise the whole procedure as good as we can.

       

      Today I was working on a login form which also is a custom component.

       

      So, this component has a remote object in order to get the user from the server if the login is succesfull.

      This user has to be passed to other components too and also in the main application which is the parent of the login.

       

      I've created a custom event which will be dispatched from the component if the login is succesfull.

      My main application is listening for this event in order to get the logged in user.

       

      That's one way of doing it.

       

      The other way would be to make the two user objects bindable and whenever the user object inside the component is ready the other one would change too.

       

      Which one do you think is the best approach to what I'm trying to do?

       

      In my opinion (since I've read a looooot about memory leaks with bindable objects) the best approach is to work with bindable objects only when its necessary.

       

       

      Your thoughts on this?