resource injection in java EE webservice

G

gk

what is a resource injection in java EE webservice ?

Could you provide some information on this.

What kind of resources are injected ?

Are these resources injected AFTER the Webservice is deloyed in the
JVM ?
 
A

Arved Sandstrom

gk said:
what is a resource injection in java EE webservice ?

Could you provide some information on this.

What kind of resources are injected ?

Are these resources injected AFTER the Webservice is deloyed in the
JVM ?

I can't speak for anyone else, but before I get into a lot of details, are
you reasonably comfortable with "dependency injection" in general?

AHS
 
G

gk

I can't speak for anyone else, but before I get into a lot of details, are
you reasonably comfortable with "dependency injection" in general?

Thanks for the post.

Yes. I am comfortable with "dependency injection" . I have gone
through that section in Spring Framework . setter Injection and
Constructor Injection .

However, my query is on resource injection (not dependency injection).
I don't think resource injection = dependency injection. I did not
find a suitable match in google. I wish to know this wording meaning.
 
L

Lew

gk said:
Yes. I am comfortable with "dependency injection" . I have gone
through that section in Spring Framework . setter Injection and
Constructor Injection .

I have come to detest Spring.
However, my query is on resource injection (not dependency injection).

Stop! Think for a minute! Do you really think Arved would have mentioned it
if it weren't relevant? Resource injection /is/ dependency injection, where
the dependency is a resource.
I don't think resource injection = dependency injection. I did not
find a suitable match in google. I wish to know this wording meaning.

Resource injection is dependency injection, where the dependency injected is a
resource handler (well, a pointer to the handler).

See the documentation at
<http://download.oracle.com/javase/6/docs/api/javax/annotation/Resource.html>
for example.

JPA uses resource injection - the '@PersistenceContext' annotation, for
example, injects a reference to a connection manager instance. (The runtime
environment must support this, as with all dependency injection.)

Have you considered taking a Java course, perhaps at a local community
college? Is that available to you?

I commend you for your persistence in learning Java.
 
G

gk

I have come to detest Spring.


Stop!  Think for a minute!  Do you really think Arved would have mentioned it
if it weren't relevant?  Resource injection /is/ dependency injection, where
the dependency is a resource.


Resource injection is dependency injection, where the dependency injected is a
resource handler (well, a pointer to the handler).

my question was "what is a resource injection in java EE webservice"

where this stuff is used in in java EE webservice ? I have done web
service coding using AXIS and Weblogic. I've not come across this
stuff. Do we really do resource injection in web service ? This is
the part I'm not clear.
 
L

Lew

my question was "what is a resource injection in java EE webservice"

You'll find that question a lot easier to answer if you eliminate incorrect
ideas, which I was helping you do. You seem resistant to the answers people
are giving you in this thread.
where this stuff is used in in java [sic] EE webservice ? I have done web

The name of the language is spelled "Java".

Well, suppose the web service needs to map entities to a persistent store
(database). It might use the '@PersistenceContext' annotation to inject an
entity manager, as I mentioned in my last response. Had you done any minimal
googling whatsoever at all in the least even a bit on the terms in that
response you likely would have run across this by now.
service coding using AXIS and Weblogic. I've not come across this
stuff. Do we really do resource injection in web service ? This is
the part I'm not clear.

Yes.
 
D

Donkey Hottie


When I last checked resource injection only worked on so called "managed
objects", meaning only Servlets and EJB 3.x session beans.

Not in some Web Service POJO's, which they are at least in Axis 1.x.

Don't know if things have changed since then...
 
T

Tom Anderson

I have come to detest Spring.

Could you, briefly at least, explain why?

Do you have an opinion on Guice?

What do you think of autowiring?

I'm still trying to work out how i feel about dependency injection
frameworks. There's at least one good idea in there, but there seems to be
a lot of cruft and madness surrounding it.

tom
 
A

Arved Sandstrom

Could you, briefly at least, explain why?
I don't know what Lew will say, but this link
(http://www.web4j.com/Criticisms_Drawbacks_Pitfalls_Spring_Rails_PHP.jsp#Spring)
sure covers all the problems I had with it, not to mention a few more that
hadn't really begun to irk me before I abandoned Spring. Granted that link
is a few years old but I doubt they've fixed all the problems - there's too
many of them.

Pretty much the main negative impression that I had of Spring, when
seriously trying to make a go of it maybe half a dozen times over the past
few years (and mostly with Spring 2.5), was that the team couldn't have made
the framework more complicated and rambling if they'd tried. The
over-reliance on XML configuration, as also explained in the link, is a big
mistake IMO. Also as mentioned in the link, Spring is bloatware: back when
Spring Security was still Acegi I experimented with that too, and ended up
needing to pull in ridiculous amounts of JARs...not to mention that the
configuration for that was clumsy too.

My belief is that the bad habits of Spring were engrained starting with its
release in 2002, and it just exploded into more badness. Java EE 5 and 6,
IMO, have eliminated any possible residual attraction that Spring may have
had.
Do you have an opinion on Guice?

What do you think of autowiring?

Interesting link: http://java.dzone.com/articles/why-you-should-use-springs

I agree with the guys that don't like it. And yeah, I tried it too. :)
I'm still trying to work out how i feel about dependency injection
frameworks. There's at least one good idea in there, but there seems
to be a lot of cruft and madness surrounding it.

tom

I know what I think the good idea is: for example, being able to get at a
session bean by using @EJB and declaring an instance variable to the
interface, rather than doing a JNDI lookup and a
PortableRemoteObject.narrow(). And so on and so forth. It's saving me some
boilerplate.

Because that's pretty much all *I* want - maybe a few dozen "macros" - I
have very little patience for something like Spring that makes it so bloody
complicated.

AHS
 
A

Arne Vajhøj

Could you, briefly at least, explain why?

Original Spring is a very good concept. It is based on KISS
and is easy to integrate in your app. You use Spring to make
loading of module configurable and thereby decouple those
components.

That was in 2003-2004.

Since then Spring has evolved into a huge monster framework
based on a "if anybody has a Foobar type library, then we need
a SpringFoobar" philosophy.

There is actually nothing wrong in still loading 10 classes
based on a XML config file to avoid coupling.

But when you take a app and decide to use 20 different Spring
this and that, then it becomes a big ugly mess.

Arne
 
L

Lew

I don't know what Lew will say, but this link
(http://www.web4j.com/Criticisms_Drawbacks_Pitfalls_Spring_Rails_PHP.jsp#Spring)
sure covers all the problems I had with it, not to mention a few more that
hadn't really begun to irk me before I abandoned Spring. Granted that link
is a few years old but I doubt they've fixed all the problems - there's too
many of them.

Pretty much the main negative impression that I had of Spring, when
seriously trying to make a go of it maybe half a dozen times over the past
few years (and mostly with Spring 2.5), was that the team couldn't have made
the framework more complicated and rambling if they'd tried. The
over-reliance on XML configuration, as also explained in the link, is a big
mistake IMO. Also as mentioned in the link, Spring is bloatware: back when
Spring Security was still Acegi I experimented with that too, and ended up
needing to pull in ridiculous amounts of JARs...not to mention that the
configuration for that was clumsy too.

My belief is that the bad habits of Spring were engrained starting with its
release in 2002, and it just exploded into more badness. Java EE 5 and 6,
IMO, have eliminated any possible residual attraction that Spring may have
had.


Interesting link: http://java.dzone.com/articles/why-you-should-use-springs

I agree with the guys that don't like it. And yeah, I tried it too. :)


I know what I think the good idea is: for example, being able to get at a
session bean by using @EJB and declaring an instance variable to the
interface, rather than doing a JNDI lookup and a
PortableRemoteObject.narrow(). And so on and so forth. It's saving me some
boilerplate.

Because that's pretty much all *I* want - maybe a few dozen "macros" - I
have very little patience for something like Spring that makes it so bloody
complicated.

What Arved and Arne said. Confronted with Spring projects, I feel like the
kid who got very excited by a room full of horse manure, exclaiming, "With all
that shit, there has just /got/ to be a pony in there somewhere!"

My assessment is based on coming in to existing Spring-based frameworks. The
latest uses old versions, including the Acegi framework. It's XML hell, but
not the worst I've seen. The worst used Spring to configure every GUI
component. You couldn't trace even the simple screen structures for love or
money. You have Java code that hides a component behind a String that looks
up a component from an XML description that requires another String to look up
a nested component that uses a String to find ...

Too much salt destroys a meal. Too much dependency injection destroys type
safety, code dependency linkages, readability, maintainability, reason,
sanity, and your love life.

I suspect I'd have had a better opinion if the real-world usages hadn't been
so egregiously mis-engineered. But so far every Spring-based app I've seen
has had these flaws. It's as if the official tenet of the framework were,
"Screw you, maintenance programmers!"

Well, screw Spring! It's ghastly. What's so danged awful about just
instantiating and using a class instance anyway?
 
A

Arne Vajhøj

My assessment is based on coming in to existing Spring-based frameworks.
The latest uses old versions, including the Acegi framework. It's XML
hell, but not the worst I've seen. The worst used Spring to configure
every GUI component. You couldn't trace even the simple screen
structures for love or money. You have Java code that hides a component
behind a String that looks up a component from an XML description that
requires another String to look up a nested component that uses a String
to find ...

Too much salt destroys a meal. Too much dependency injection destroys
type safety, code dependency linkages, readability, maintainability,
reason, sanity, and your love life.

I suspect I'd have had a better opinion if the real-world usages hadn't
been so egregiously mis-engineered. But so far every Spring-based app
I've seen has had these flaws. It's as if the official tenet of the
framework were, "Screw you, maintenance programmers!"

Well, screw Spring! It's ghastly. What's so danged awful about just
instantiating and using a class instance anyway?

To glue layers/components together then it is a fine mechanism. If
not using Spring we would something else.

The problem arise when it gets extended not only to be used
to decouple layers/components but get used to replace the
new keyword in 1/2 the lines of the entire app.

Arne
 
G

gk

gk said:
my question was "what is a resource  injection in java EE webservice"

You'll find that question a lot easier to answer if you eliminate incorrect
ideas, which I was helping you do.  You seem resistant to the answers people
are giving you in this thread.
where this stuff is used in in java [sic] EE webservice ? I have done web

The name of the language is spelled "Java".

Well, suppose the web service needs to map entities to a persistent store
(database).  It might use the '@PersistenceContext' annotation to inject an
entity manager, as I mentioned in my last response.  Had you done any minimal
googling whatsoever at all in the least even a bit on the terms in that
response you likely would have run across this by now.
service coding using AXIS and Weblogic. I've not come across this
stuff. Do we really do resource  injection in web service ? This is
the part I'm not clear.

Lew, Could you please do me a favor. Will it be possible for you not
to answer my post ? I'd be happy if you kindly not post response to my
post. you are free not to post any response to my post.Please don't
hijack my post. Don't waste your time .Use your valuable time with
some meaningful work you like. No offence . No arguments please .
This is a request .Thanks for all your time and responses.

It seems to me you are more interested in abuses than answering to the
original post. Fortunately, here I have found some gentle,helpful and
knowledgeable persons who are ready to help. Please let them post
their comments .I don't find your post helpful rather attacking
attitude. Also, There have been several occurances where you have
posted wrong information. That was very much unfortunate.Kindly,
please don't hijack my post next time.

Thanks for your time.
 
L

Lew

gk said:
It seems to me you are more interested in abuses than answering to the

You misunderstand. I mean no harm.
original post. Fortunately, here I have found some gentle,helpful and
knowledgeable persons who are ready to help. Please let them post
their comments .I don't find your post helpful rather attacking
attitude. Also, There have been several occurances where you have
posted wrong information. That was very much unfortunate.Kindly,
please don't hijack my post next time.

You misrepresent my actions. This is a discussion group. You are correct
that sometimes I made mistakes. That happens, and I apologize for them. But
I have also given you some good information, which you seem not to mention,
and you have to understand that I make recommendations to help you. For
example, we who voluntarily engage in your questions, out of no compensation
than the pleasure of interacting about a language in which we're all
interested, would appreciate it if you would follow through on the answers we
give. That means, in good measure, using search engines and documentation to
look up more information than we can give here. If you find that suggestion
insulting, too bad for you, because that's good advice right there.

I'm truly sorry you don't like my posts. You should try interpreting them
better, though. I'm not attacking you - I'm always like this.

As for the quality of my responses, I just reviewed what I've said in this
"resource injection" thread and I don't see your problem with the information
I've given. So drop the hostility and let's all continue to play together.
 
L

Lew

gk said:
It seems to me you are more interested in abuses than answering to the

The thing I find really peculiar about your reaction is that the only personal
remark I've made to you was a compliment. How you turn a compliment into
"abuses" puzzles me.


Yeah, that's abusive.

Not.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top