Is there an equivalent in CDI(WELD) to build definitions (as done in Guice modules) and then create an Injector? -


I like Guice to manually manipulate each module of his own with his own binding done in the coding To make straight forward is straight forward. On the other hand, the CDI believes more from the side of magic, rather than access to programming sext binding. I am wrong or can get the same effect with WELD.

Any code sample would be appreciated ...

Clarification

I was hoping to create

I used to be a dynamic system I am building and I need to be able. I scan the weld dynamically classpath etc. instead of bind type (like interface), constants etc. and find the types and register. I believe that the CDI is static, the javax.inject package does not include any interface that allows anyone to implement the types of programming.

Clarification Part 2

The basic premise of the original question was this simple observation that cooked in annotation and the rules set for the help of the injector can not be changed. I basically wanted public access to the same interface that the CDI CellPath Scanner uses to make definitions for its internal use. Actually I'm saying that I want a layer that reads the annotations and the definitions of the container allows for. A default provider can be what happens now, but if you want some other strategy then there is a possibility to do so.

One problem with the current perspective is that no components can be reused (with different comments to select different partners) before you jump, To qualify, yes, it can be done with providers and such people but leads to more artifacts. An easy way should be

Example 1

Sorry, if this example is poor, then my use case is more involved and the extension will be available and read for more time.

Imagine that there is a URL reconstruction component for which some criteria for reasoning such as

  • replace this pattern with that pattern.
  • Maybe a html cleaner

If you want to inject this component with two different replacement rules but if you have an HTML cleaner injector, then your Got trapped Sure, there are ways around this, but they require artifacts, which are definitely more code.

Unfortunately, all the binding rules are on the class, for example, every time you ask for a class that you are pretty quick contemporary example.

WELD

This question was written before a wheel, I have left the weld. I believe that the way it decides how its magic is done is wrong. I do not like the fact that they give me instructions on how it controls when I want to start this verb again. I do not like this pricelessness

I use Guice and CDI / Seam2 on a regular basis. The short answer is not , the definition of the CDI programmatic bean (does not support 'binding' because it speaks).

The CDI uses a declarative approach where the container will scan automatically Bean definitions can be customized to some extent with 'optional' features, but it is flexible in terms of Guwah's programmatic approach (Where you can basically do anything).


I use the both frameworks: "low level" non-enterprise POJO components (where I do not have / CDI specifications are required) for CDs, where additional features of CDI are required, things that have been plugged in JSF or EJB3, primarily as a way of getting DI in 'Adapter' JVM Started using Guice, which is the application C server is a part of the cluster. As I am more familiar with the CDI, I am getting less than the requirement of Guice though I imageine that when CDI supports 'unmanaged' instances then I may be able to replace Guice with CID (like weld -sa).

RE: Weld 'Magic' - IMO Bean Definition is not about 'magic' about scanning. This is really well-defined in the CDI spec, and it is similar to other Java Enterprise frameworks like JPA and EJB3.

My advice is to:

  1. Use what works for you if you do not like the cds, then do not use it. Please. For example, I need 'unmanaged example' in my app, so I use Guice for this.
  2. If you think that the CDI can be better (I do), join - participating in the CDI defined community

Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -