Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client 需要在代码中手动创建 Bean 对应的 BeanDefinition对象。 #2

Closed
liangkuai opened this issue Jul 15, 2020 · 1 comment
Labels
defect v0.0.1 Version 0.0.1

Comments

@liangkuai
Copy link
Owner

liangkuai commented Jul 15, 2020

开发人员不仅要初始化和管理大量 Bean 实例,还要再创建 BeanDefinition 对象手动注册到 BeanFactory 中,那不是增加工作量吗?而且这个 IoC 容器和 Map 没什么区别。

BeanFactoryTest

// 2. 注册 bean
BeanDefinition beanDefinition = new BeanDefinition(new HelloService());
beanFactory.registerBeanDefinition("helloService", beanDefinition);
@liangkuai liangkuai added enhancement New feature or request v0.0.1 Version 0.0.1 defect and removed enhancement New feature or request labels Jul 15, 2020
@liangkuai
Copy link
Owner Author

使用 xml 文件配置 Bean 的定义。使用读取器解析 xml 配置文件并生成 BeanDefinition 对象。

参考「v0.0.4」

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect v0.0.1 Version 0.0.1
Projects
None yet
Development

No branches or pull requests

1 participant