Reputation: 434
Can anyone explain with a simple way ( or with a simple tutorial IF exists on web ), how a Spring IOC application could be run, and do just a CRUD job?
I did this: 1. With hibernate created class specific files. 2. Extended these classes to "beans" that beside extending hibernate objects, do some business staff. 3. Created some middler classes that do operation job with wider scope 4. Created an applicationContext file. 5. All the "beans" are consumed through a "Middleman" Some plugin mechanism. For example CarType class, where in Spring's applicationContext I assigned to be several class of CarType class. So an iteration on that, supposes to fetch all those beans of CarType.
Unfortunatelly, in the end, I ended up doing that: CarBean car = new CarBean() or CarBean car = CarBean.load(long id ) ! Suddenly Spring was useless again. Where does Spring fits? How is it used ? In clever way.
In the web, I see all the time, tutorials about funcy bean mechanisms or the spring docs that are frustrating. But no meat!
The only clue, I had from the previous application that I maintained, was that it supposed to run beans in memory, and then beans retrieve data from db.
If you find it awful all this, imagine that my company had many changes, and the burden of this fell on me. The guy who wrote that Spring in the first place, never commented a line. And used naming schemes that made me suffer. I had to read Spring/Hibernate/PHP/.net/asp.net and many more. Now I write a new application and try to make up some good things,I fear I lost it somewhere though...
Thank you in advance...
Upvotes: 1
Views: 258
Reputation: 80186
First it is little bit overwhelming when we get introduced to a DI framework and it is a paradigm shift in the way we program. Most of us were in the same boat in the begining. But if you understand some basic concepts then everything starts to make sense. I suggest you do some reading in the below order.
Upvotes: 2