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
WELD-1795 Add builder for custom beans #17
Conversation
* @return self | ||
*/ | ||
BeanBuilder<T> read(AnnotatedType<T> type); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about read(BeanAttributes) version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it make sense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could enable some more usecases. For example we have BeanManager.createBeanAttributes(AnnotatedMember<?> type) that could be used to load BeanAttributes which are then altered in bean builder
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, why not.
* @param callback | ||
* @return self | ||
*/ | ||
BeanBuilder<T> disposeWith(Consumer<T> callback); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't destroyWith vs disposeWith naming be confusing? Won't people be thinking that they need to provide both? Using an overloaded method would IMHO make it more straightforward.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea was to follow the naming of createWith()/produceWith(). createWith()/destroyWith() should correspond to Contextual.create()/destroy(), whereas produceWith() callbacks are special constructs similar to producers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, let's leave it this way for now.
No description provided.