Announcement Announcement Module
Collapse
No announcement yet.
init methods before properties set? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • init methods before properties set?

    Hi,

    I was just wondering if an init method specified on an object should occur after all properties have been set on all other objects in the ApplicationContext (as in the Java Spring)

    as an example I have two objects ...
    ScheduleManager
    DownloadManager

    ... DownloadManager has a reference to ScheduleManager, and in its setter adds a listener for when a Schedule is downloaded, and a schedule is first downloaded (or loaded from a file synchronously) in the ScheduleManager init method

    So I would expect things to happen in this order
    1. DownloadManager / ScheduleManager constructed
    2. setScheduleManager called on DownloadManager
    3. init called on ScheduleManager

    But I can see it happening in the step 3 and then 2 order.

    Just wondering if i'm on the right path thinking things should happen in this order.

  • #2
    You are correct

    You may try using the IInitiatingObject interface instead of an init method.
    you need to implement
    public void afterPropertiesSet():void

    Comment

    Working...
    X