Hi all, i develop here an app with spring,jpa,struts2, and i use spring to inject my service objects into struts actions using IoC. As i said before i also use jpa (jpa entities), and i do not know if in order to use a entity into a service class i have to inject this entity into service via IoC also, or i should use new keyword. I know that the new keyword is "bad" and should be avoided. Which is the best practice ?
I don't know spring and I believe much of what your saying is beyond my understanding, but I can't imagine new should ever be avoided, the new keyword is used to instantiate objects in java.
Why did you post this more than once?
It's rude, and can result in people simply ignoring you...
See my reply in the Advanced section.
Hi, sorry for this, i din not wanted to be rude, but i posted here by mistake and si did not know how to move this to advanced section.
sorry once again.
I'h closing this thread; you can continue the discussion in the identical thread in the Advanced Java section.