The Artima Developer Community
Sponsored Link

Java Buzz Forum
Dependency Injection of Domain Objects in Hibernate?

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Geoffrey Wiseman

Posts: 51
Nickname: diathesis
Registered: Aug, 2003

Geoffrey Wiseman is a software professional.
Dependency Injection of Domain Objects in Hibernate? Posted: Apr 19, 2005 9:04 PM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Geoffrey Wiseman.
Original Post: Dependency Injection of Domain Objects in Hibernate?
Feed Title: Furious Purpose
Feed URL: http://www.jroller.com/diathesis/feed/entries/rss
Feed Description: Thoughts and experiences on technology and software.
Latest Java Buzz Posts
Latest Java Buzz Posts by Geoffrey Wiseman
Latest Posts From Furious Purpose

Advertisement

An application with which I'm currently working is doing a reasonable amount of dependency injection using Spring. It's difficult to inject dependencies into the domain objects, as they are currently created either by client code or by Hibernate itself. This results in code migrating upwards from the domain to the service layer. The service layer, which was intended to be light connective tissue, becomes increasingly thick and increasingly tightly coupled to the domain.

In order to inject dependencies, there would need to be some control exercised over the creation of these domain objects. The client code could be changed to a factory method, which would give some injection possibilities, but I'm not terribly fond of that. Under Hibernate we have even less options; I'd have to implement a Hibernate interceptor that, after object creation, attempts to inject dependencies.

So... thoughts? Are you injecting your domain?

Read: Dependency Injection of Domain Objects in Hibernate?

Topic: Personal Profile for Sharp's Zaurus Previous Topic   Next Topic Topic: Using Ivy in AppFuse

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use