(Item 1) use static factory to substitute constructors
2007-05-06 23:54
423 查看
(Item 1) use static factory to substitute constructors
more meaningful name than constructor name
don’t require to create new instance each time they’re invoked
return object of any subtype (map string key to class name, reflection: spring creation mechanism)
more meaningful name than constructor name
don’t require to create new instance each time they’re invoked
return object of any subtype (map string key to class name, reflection: spring creation mechanism)
相关文章推荐
- 实习第16天 开新坑 Effective Java 英文 第二版 读书笔记 Item 1: Consider static factory methods instead of constructors
- Effective Java——Item 1: Consider static factory methods instead of constructors
- Effective Java——Item 1,Consider static factory methods instead of constructors
- Effective Java - Item 1: Consider static factory methods instead of constructors
- How do I fix "selector not recognized" runtime exceptions when trying to use category methods from a static library?
- When to use static method in a java class
- Item3:Use objects to manage resources--以对象管理资源
- Effective Objective-C 2.0: Item 44: Use Dispatch Groups to Take Advantage of Platform Scaling
- Use the ItemDataBound event to customize the DataGrid control.
- Item 13:Initialize Static Class Members with Static Constructors
- Any Substitute Of Cactus? How To Use Cactus?
- jQuery插件编写:How to use Widget Factory(五)
- How to use 'SetItemData()' and 'GetItemData()'?
- Item 45: Use member function templates to accept "all compatible types."(Effective C++)
- iOS 5 Storyboard: How To use Segues, Scenes and Static Content UITableViews--Part II
- Effective C++ Item 18 Make interfaces easy to use correctly and hard to use incorrectly
- use cmake to compile static library and test
- Use a Static Route to the Null0 Interface for routing Loop
- When to Use Static Classes in C#
- Effective Objective-C 2.0: Item 35: Use Zombies to Help Debug Memory-Management Problems