spring实现UML类图
2021-03-30 22:23:22 0 举报
spring实现UML类图
作者其他创作
大纲/内容
GenericBeanDefinition
继承
RuntimeBeanReference
-beanName+getBeanName()
<<interface>>BeanFactory
+ getBean(String beanID)
ConstructorArgument
argumentValues: List<ValueHolder>+addArgumentValue(ValueHolder valueHolder)+getArgumentValues()
PropertyValue
-name-value+getName()+getValue()
FileSystemResource
<<interface>>Resource
+ getInputStream()
实现
ClassPathXmlApplicationContext
依赖
DefaultSingletonBeanRegistry
<<interface>>BeanDefinition
+ getBeanClassName()+ getPropertyValues()+getConstryctorArgument()
<<interface>>SingletonBeanRegistry
ValueHolder
value
通过DefaultBeanFactory获取Bean实例 1.DefaultBeanFactory factory = new DefaultBeanFactory(); 2.XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(factory); 3.Resource resource = new ClassPathResource(\"petstore-v1.xml\") 4.reader.loadBeanDefinitions(resource); 5.PetStoreService petStore1 = (PetStoreService)factory.getBean(\"petStore\");
TypedStringValue
-value+getValue
XmlBeanDefinitionReader
- BeanDefinitionRegistry registry+ loadBeanDefinitions(Resource resource)
+ getBeanClassName()+ getPropertyValue()
ClassPathResource
<<abstract>>AbstractApplicationContext
<<abstract>>getResourceByPath(String path)
DefaultBeanFactory
span style=\"font-size: inherit;\
FileSystemXmlApplicationContext
<<interface>>ApplicationContext
<<interface>>BeanDefinitionRegistry
AbstractApplicationContext构造器:public AbstractApplicationContext(String configFile){ factory = new DefaultBeanFactory(); XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(factory); Resource resource = this.getResourceByPath(configFile); reader.loadBeanDefinitions(resource); }通过ApplicationContext 获取Bean实例: ApplicationContext ctx = new ClassPathXmlApplicationContext(\"petstore-v1.xml\"); PetStoreService petStore = (PetStoreService)ctx.getBean(\"petStore\");
-value+getValue()
propertyValues:Listpropertyvalue.><propertyvalue> /propertyvalue.>
收藏
0 条评论
下一页