Time |
S |
Nick |
Message |
23:12 |
|
|
philbot joined ##javaee |
23:12 |
|
Quest |
When the application under question is small, we can always meet the needs by injecting dependencies manually, without using any framework like Spring. says http://www.javacodegeeks.com/2010/12/dependency-injection-manual-way.html |
23:13 |
|
pdurbin |
hello world! logging at http://irclog.greptilian.com/javaee/today thanks to philbot :) |
23:14 |
|
|
philbot joined ##javaee |
23:15 |
|
Quest |
be right back. |
23:15 |
|
sfisque |
basically what they're doing is manually "injecting" the references either via mutator (setXXX) or via the constructor ( new A( x, y, z ); |
23:16 |
|
pdurbin |
I only recently starting trying to figure out @Inject and the like: switch to own servlets to inject EJBs · 4658558 · IQSS/dvn - https://github.com/IQSS/dvn/commit/46585583da4866589d98b1fe8e1d307a7181176c |
23:17 |
|
sfisque |
which is kind of the point of pojo's. you loosely couple the references (they're set via either DI, mutator, or construction) and the object does not care where they come from |
23:23 |
|
pdurbin |
sfisque: you're doing more than just lurking. which is great :) |
23:24 |
|
sfisque |
Q and i have history. we spent about an hour last night banteringa bout this |
23:25 |
|
pdurbin |
sfisque: yes I read through http://echelog.com/logs/browse/netbeans/1374012000 last night. so chatty! ;) |
23:25 |
|
sfisque |
lolz |
23:26 |
|
Quest |
sfisque, ok. and i think interface injection is very possible without a framework. like http://pastebin.com/Nyy6As14 ??????????? |
23:26 |
|
Quest |
be right back. |
23:29 |
|
pdurbin |
oh, here's where I let the founder of this channel (neuro_sys) know that I started logging it: http://www.evanchooly.com/logs/%23%23jsf/2013-07-17 |
23:29 |
|
sfisque |
negative. someone has to do the injection. you're either doing it explicitly via mutator/constructor or some framework is intercepting calls via reflection proxies and performing interposing |
23:30 |
|
sfisque |
if you're doing it explicitly, it's not "really DI"... you're just doing explicitly what a framework would perform for you "auto-magically" |
23:30 |
|
* pdurbin |
invites people in ##java to join this channel: http://www.evanchooly.com/logs/%23%23java/2013-07-17 |
23:34 |
|
|
Topic for ##javaee is now Java Enterprise Edition (Java EE) discussion | logs at http://irclog.greptilian.com/javaee/today |
23:36 |
|
|
whartung joined ##javaee |
23:37 |
|
whartung |
so is this new, or simply unloved and abandoned |
23:39 |
|
Quest |
sfisque, so its not real DI? a real di would be like MyInterface mi = context.get. blabla(className) ? |
23:39 |
|
sfisque |
so new, it's still got the smell :P |
23:39 |
|
Quest |
sfisque, without the "new" keyword i mean |
23:40 |
|
Quest |
am I correct? |
23:40 |
|
sfisque |
Q: no, it would be like class A { X x; }. A a = new A(); and x is populated for you by the framework (you don't have to instantiate it) |
23:41 |
|
pdurbin |
whartung: not sure! :) |
23:41 |
|
Quest |
hm |
23:41 |
|
Quest |
oh we have a new joiner. whartung |
23:41 |
|
sfisque |
in a really decoupled setup, you'd ask for an A from some pool via JNDI or such (like we did in EE in the "old days") |
23:41 |
|
Quest |
sfisque, so its not real DI? a real di would be like MyInterface mi = context.get. blabla(className) ? |
23:41 |
|
Quest |
sfisque, oh |
23:42 |
|
sfisque |
basically, DI manageds instances in a pool and "injects" one when needed. |
23:43 |
|
Quest |
as for A via JNDI ? so thats what frameworks do? how do they or spring give you a new object from the context without a "new key word" . they do instanciate it. right? |
23:43 |
|
sfisque |
at least, that's the general implementation in EE. as for spring and other non EE containers, they will do it however they see fit |
23:43 |
|
Quest |
sfisque, i see. how does it injects?? |
23:43 |
|
sfisque |
java.lang.reflect.Proxy |
23:44 |
|
Quest |
sfisque, by a proxy class? |
23:44 |
|
sfisque |
yes |
23:44 |
|
Quest |
hm i have the idea of that a bit. |
23:44 |
|
whartung |
you don't need a proxy to inject, it injects via reflection |
23:44 |
|
whartung |
you need a proxy to wrap methods with behavior, not DI |
23:44 |
|
Quest |
just like hibernate proxy or any other proxy class? calling some super methods and doing some its own things? |
23:45 |
|
sfisque |
yes. the container gives you a proxy, but you don't "know" it. As far as you're concerned, it's the "real thing" |
23:45 |
|
Quest |
whartung, i have to make you op for that |
23:45 |
|
whartung |
op? |
23:45 |
|
whartung |
o |
23:45 |
|
Quest |
yes. this.op |
23:46 |
|
whartung |
with great power cones great ignorance... |
23:46 |
|
whartung |
*comes |
23:46 |
|
Quest |
sfisque, is there any way I can see that happening. without any framework? |
23:46 |
|
* whartung |
is lucky he can spell IRC |
23:46 |
|
sfisque |
whartung, the proxy is in order to intercept method calls so you know "when" to perfrom the injection |
23:46 |
|
Quest |
whartung, thats the ##java logo |
23:46 |
|
sfisque |
lolz |
23:47 |
|
sfisque |
Q: a debugger |
23:47 |
|
Quest |
Q? |
23:47 |
|
whartung |
give me an example sfisque |
23:47 |
|
sfisque |
i live inside the netbeans debugger. you discover some funky stuff about EE that way |
23:48 |
|
sfisque |
put a class break point in a session bean. look at the call stack when a reference gets materialized |
23:49 |
|
sfisque |
you see some pretty funky stuff :P |
23:50 |
|
Quest |
sfisque, is there any way I can see that happening. without any framework? |
23:52 |
|
sfisque |
like i said, unless you're just doing the injection explicitly via mutator/constructor, you have to have a framework doing it. unless they are sneaking DI into 8se.. which i'm not aware of |
23:55 |
|
Quest |
DI into 8se ? |
23:55 |
|
Quest |
oh. they are not. i gues |
23:56 |
|
Quest |
well actually I want to do what frameworks do.... frameworks are nothing but java classes and configs. now I only want to DI like a framework for only one or two classes |
23:57 |
|
Quest |
iam a very different guy. I cannot proceed unless I absorb and agree to something with understanding. this is a reason i am banned in ##java for asking too many questions which most dont care |