I think you should use the path helpers. I know that it feels like it’s breaking the boundary, but the web concern truly is a dependency for this email, no?
but the web concern truly is a dependency for this email, no?
I feel like it’s not that there’s a web concern that’s a dependency, but that there is a dependency IN the web layer that I’d like access to. Perhaps I’m over thinking this but it seems like routes are just strings. They only get meaning and behavior when looked at from a web browser’s perspective. Otherwise, they’re just strings in a certain shape. But yeah, perhaps over thinking.
Looks like I’ll include MyApp web and just finish the feature
Another option is to place all the email specific functionality (Mailer module, Email module, views, templates) into a separate directory in lib next to, but dependent upon, MyApp and MyAppWeb under something like MyAppMail.
Problem is that if he wants to actually make sure everytime a domain logic is called the email is sent. The best way to do that is to write the email on domain logic too, if he creates a new folder and call that folder code from MyApp, which then calls code from MyAppWeb, then indirectly MyApp still depends from MyAppWeb. And if he calls the email logic from MyAppWeb, he has to remember to do that manually everytime the specific domain logic is called.
Yeah, separating the email modules out on their own probably helped me somewhat justify in my mind that making the dependencies obvious and self-contained ameliorated the smell of the implied dependency. But it doesn’t. I experimented with passing the URLs in various cases (scheduled messages, controller, etc.), but wasn’t too happy with it. The UrlProvider post mentioned in an earlier message above seems like a clean way to do it though. Thanks for the push to get back to eliminating this dependency.