Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify access specific builders #89

Open
aurelien-baudet opened this issue Dec 29, 2019 · 0 comments
Open

Simplify access specific builders #89

aurelien-baudet opened this issue Dec 29, 2019 · 0 comments

Comments

@aurelien-baudet
Copy link
Member

aurelien-baudet commented Dec 29, 2019

Currently developer must know about Builder classes to chain and configure:

MessagingBuilder.standard()
  .email()
    .sender(JavaMailBuilder.class)
      .host("localhost")

There should be direct access to well-known senders and template engines:

MessagingBuilder.standard()
  .email()
    .javamail()
     .host("localhost")

The issue with this behavior is that core knows about all other modules (core should be agnostic about possible implementations) and it can't be compiled due to cyclic dependencies (javamail() method should provide a way to find the right builder that works even after refactoring code of JavaMail module).

Another possibility is simply to "centralize" all builders in ogham-all module:

MessagingBuilder.standard()
  .email()
    .sender(OghamSenders.javamail())
      .host("localhost")

However, if we don't use ogham-all module, we won't benefit from this helper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant