Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

13
  • You have not tagged a language or platform, but I recommend looking into cron. Your platform may have a library that works similarly (e.g. jcron which seems sort of defunct). Scheduling jobs and tasks is largely a solved problem: have you looked into other options before rolling your own? Were there reasons for not using them? Commented May 21, 2015 at 17:40
  • @Snowman We may switch to a mature library later. It all depends on my manager. The reason I post this question is I want to find a way to solve this 'kind' of problem. I've seen this kind of problem more than once, and couldn't find out an elegant solution. So i am wondering whether i did something wrong. Commented May 21, 2015 at 17:50
  • Fair enough, I always try to recommend code reuse if possible though. Commented May 21, 2015 at 18:05
  • 1
    SendEmailTask seems more like a service than an entity to me. I would go for option 1 without and hesitation. Commented May 21, 2015 at 18:10
  • 3
    What's missing (to me) for Visitor is the class structure that accepts visitors. The motivation for Visitor is that you have many class types in some aggregate that need visiting, and it's not convenient to modify their code for each new functionality (operation). I still don't see what those aggregate objects are, and think that Visitor is not appropriate. If it's the case, you should edit your question (which refers to visitor). Commented May 21, 2015 at 21:18