-
Jul 5th, 2006, 07:12 AM
#1
Parent bean, factory and constructor-args
We have a factory bean we are writing. Currently, it takes 3 arguments in it's constructor, 2 of which are always the same, and 1 which will always vary.
I'd like to use an 'abstract bean definition', but it doesn't seem possible since this is not a property-based factory. Is there a way to do it? When I tried, splitting the arguments between two bean definitions, it said it could match the constructor. I even used 'index'.
Thanks.
David
-
Jul 10th, 2006, 11:49 AM
#2
I would suggest putting the variable property to not be in the constructor but set as a property. Then use an init-method do any special post constructor processing. If your factory bean uses Spring interfaces you can implement InitializingBean and instead of an init-method use afterPropertiesSet.
Bill
-
Jul 11th, 2006, 03:19 AM
#3
you won't even need an init() method, as you can validate all your params (2 for constrcuor, 1 for property) within setProperty() method.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules