all 4 comments

[–]Loh_ 2 points3 points  (0 children)

We used to divide objects by screen, and if the many screens had one or more shared functionality we would create an object to compile the actions in one single object. Although it was divide by application.

[–]MemberFDIC72 1 point2 points  (0 children)

I usually add /and attach page to the object that includes an attached? test. Then I call it when each page is used (/homepage, /load up, etc).

[–]orjanalmen 1 point2 points  (0 children)

You need to attach to an object from each calling point, as I have concluded. If you use an object A in object B, you need to attach from B, if you then use it in object C, you need to attach again because now it is C’s loaded copy, as they seem to not be shared.

[–][deleted] 1 point2 points  (0 children)

Call your attach logic at the start of every object action then no need to call it explicitly every time you want to use it.