Skip to main content
Commonmark migration
Source Link

how can I make sure he registered to that event ?

 

how can I make sure he didn't forget to "stop the process at some point"

how can I make sure he registered to that event ?

 

how can I make sure he didn't forget to "stop the process at some point"

how can I make sure he registered to that event ?

how can I make sure he didn't forget to "stop the process at some point"

Tweeted twitter.com/StackProgrammer/status/724435375050096640
deleted 707 characters in body
Source Link
Robert Harvey
  • 200.7k
  • 55
  • 470
  • 683

EDIT : About the possible duplicate of this question : those questions are entirely different. I'm not considering whether or not I should call 1 big method vs many small ones. I'm asking for a way to make sure that method is called at all. Weather it's a small Init() or many calls is irrelevant.

 

I'm quite excited to see how people are interested and giving their best. There are very good answers and comments, which is really nice! There are some names here that I didn't expect to see, and I am very thankful for everyone ('of' everyone?).

To clarify many questions here :

Also, that class has events that must bé listened to, like "AdClicked" for example. Everything works fine if not listened to, but we lose tracking of analytics there if taps aren't registered. The Ad still works though, so the user and developer won't see a difference, and analytics will just have wrong data. That needs to be, avoided, but I'm not sure how developer can know they must register to the tao event. That is a simplified example though, but the idea is there, "make sure he uses the public Action that is available" and at the right times of course!

Please keep asking for clarifications if needed, I'm living everything you guys said!

I'll find an example next week at work and I'll show some code.

EDIT : About the possible duplicate of this question : those questions are entirely different. I'm not considering whether or not I should call 1 big method vs many small ones. I'm asking for a way to make sure that method is called at all. Weather it's a small Init() or many calls is irrelevant.

I'm quite excited to see how people are interested and giving their best. There are very good answers and comments, which is really nice! There are some names here that I didn't expect to see, and I am very thankful for everyone ('of' everyone?).

To clarify many questions here :

Also, that class has events that must bé listened to, like "AdClicked" for example. Everything works fine if not listened to, but we lose tracking of analytics there if taps aren't registered. The Ad still works though, so the user and developer won't see a difference, and analytics will just have wrong data. That needs to be, avoided, but I'm not sure how developer can know they must register to the tao event. That is a simplified example though, but the idea is there, "make sure he uses the public Action that is available" and at the right times of course!

Please keep asking for clarifications if needed, I'm living everything you guys said!

I'll find an example next week at work and I'll show some code.

 

To clarify many questions here :

Also, that class has events that must bé listened to, like "AdClicked" for example. Everything works fine if not listened to, but we lose tracking of analytics there if taps aren't registered. The Ad still works though, so the user and developer won't see a difference, and analytics will just have wrong data. That needs to be, avoided, but I'm not sure how developer can know they must register to the tao event. That is a simplified example though, but the idea is there, "make sure he uses the public Action that is available" and at the right times of course!

small minor fixes.
Source Link
Gil Sand
  • 2.2k
  • 3
  • 21
  • 23

Here I remember an Ad fetching class. As long as the view where the Ad is visible is visible, the class would fetch a new ad every minute. That class needs a view when constructed where it can display the Ad, that could go in a parameter obviously. But once the view is gone, StopFetching() must be called. Otherwise the class would keep fetching ads for a view that isn't even there, and that's bad.

Here I remember an Ad fetching class. As long as the view where the Ad is visible, the class would fetch a new ad every minute. That class needs a view when constructed where it can display the Ad, that could go in a parameter obviously. But once the view is gone, StopFetching() must be called. Otherwise the class would keep fetching ads for a view that isn't even there, and that's bad.

Here I remember an Ad fetching class. As long as the view where the Ad is visible is visible, the class would fetch a new ad every minute. That class needs a view when constructed where it can display the Ad, that could go in a parameter obviously. But once the view is gone, StopFetching() must be called. Otherwise the class would keep fetching ads for a view that isn't even there, and that's bad.

added 2752 characters in body
Source Link
Gil Sand
  • 2.2k
  • 3
  • 21
  • 23
Loading
"it's" means "it is". "its" is the pronoun. Spelling.
Source Link
Adam Zuckerman
  • 3.7k
  • 1
  • 21
  • 27
Loading
"it's" means "it is". "its" is the pronoun. Spelling.
Source Link
Loading
Question Protected by gnat
added 591 characters in body
Source Link
Gil Sand
  • 2.2k
  • 3
  • 21
  • 23
Loading
typo corrected
Source Link
gnat
  • 20.5k
  • 29
  • 117
  • 310
Loading
Source Link
Gil Sand
  • 2.2k
  • 3
  • 21
  • 23
Loading