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

WELD-1795 Add builder for custom beans #17

Merged
merged 3 commits into from Feb 16, 2015
Merged

Conversation

mkouba
Copy link
Member

@mkouba mkouba commented Feb 10, 2015

No description provided.

* @return self
*/
BeanBuilder<T> read(AnnotatedType<T> type);

Copy link
Member

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense?

Copy link
Member

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

Copy link
Member Author

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);
Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member

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.

@jharting jharting merged commit 8eba283 into weld:master Feb 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants