Results 1 to 5 of 5

Thread: Spring IoC

  1. #1
    videanuadrian is offline Member
    Join Date
    Dec 2010
    Location
    Bucharest Romania
    Posts
    40
    Rep Power
    0

    Default Spring IoC

    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 ?

    Thank you.

  2. #2
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default

    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.

  3. #3
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,044
    Rep Power
    20

    Default

    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.

  4. #4
    videanuadrian is offline Member
    Join Date
    Dec 2010
    Location
    Bucharest Romania
    Posts
    40
    Rep Power
    0

    Default

    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.

  5. #5
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,570
    Blog Entries
    7
    Rep Power
    21

    Default

    I'h closing this thread; you can continue the discussion in the identical thread in the Advanced Java section.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

Similar Threads

  1. Replies: 1
    Last Post: 12-27-2010, 05:21 PM
  2. spring mvc
    By karq in forum Advanced Java
    Replies: 0
    Last Post: 12-13-2010, 04:28 PM
  3. spring mvc
    By jpnr99 in forum New To Java
    Replies: 4
    Last Post: 10-14-2010, 09:58 AM
  4. EJB 3.0 VS Spring
    By nanaji in forum Advanced Java
    Replies: 4
    Last Post: 01-28-2009, 04:58 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •