Skip to content

Improve legacy bean support via overrides arg to getBean() #399

@seancorfield

Description

@seancorfield

When migrating existing code to FW/1 & DI/1, it would be convenient to be able to tell getBean() "Hey, here are the constructor arguments I want you to use (instead of looking in the factory)!":

var foo = factory.getBean( "foo", { arg1 : 1, arg2 : "two" } );

These could simply be dynamic overrides for the bean being created (augmenting the optional overrides that a bean can be declared with).

This is a very common request and even tho' I nearly always push back and say "That's the wrong way to do it -- use an explicit factory (bean) instead", it actually doesn't look all that difficult to implement (unless I'm missing something obvious that has prevented me from wanted to undertake this in the past!).

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions