Guys,
Can we use Spring without IOC or Dependency of Injection?
Thx
Guys,
Can we use Spring without IOC or Dependency of Injection?
Thx
Well Spring is modular by design, you can use as little or as much as you like. If you want to just the new operator to create objects instead of letting Spring do it, its possible. But why would you want to?
What problem are you trying to solve with Spring?
guys,
IOC/Dependency of Injection leads to proliferation of interfaces rite? need to get rid of this.
thx
Not quite sure what your getting at. But as I said you can use what you want and leave what you don't.
DI is not visible in the interface. The implementation has a constructors/setter to place the dependencies, but this is just an implementation detail (only visible inside the IOC-container). Code doesn't depend on concrete implementations but on interfaces and in the interfaces there are no setters (in most cases) and no constructors. So DI/IOC is not visible in the interface.
Could you give an example of what you find problematic with IOC/DI
blog: http://pveentjer.wordpress.com project: STM Implementation http://multiverse.googlecode.com
Although its recommended to use interfaces with Spring there is no requirement to so. Interfaces allow you to use proxy-based AOP with Spring. But you can certain use CGLIB based proxies if you don't want to use interfaces.
But why do you need to get rid of interfaces?
Bill
I had a standalone java project where it was useful to map certain pojos to records in a fixed-record file, some of these files containing 900,000 records. Java.nio, all of that, basically mapping pojo properties to fields in a ByteBuffer. I found BeanWrapperImpl and the custompropertyeditor stuff *very* useful for that kind of thing. Given the nature of the project I didn't really need much else from spring.
Not that I fully understood your situation - the tea leaves tell me that Jakarta BeanUtils might be a better tool for you here.![]()
--Jing Xue
I went through BeanUtils. For the level of abstraction I needed it just didn't do the trick. CustomPropertyEditors - the spring way of handling them is much better, plus it allows you to configure bean properties, not just the class that the property is. BeanName.propertyName, in that manner.
I had bean properties that were classes like ZonedDecimal ... things that don't exist in Java.