范例解说DI和DI容器 - 轻松理解DI

http://blog.sina.com.cn/s/blog_4ed66efa01000bsv.html
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
DIContainers is a collection of more than 100 individual container classes for Delphi (Embarcadero, CodeGear, Borland). Four different container structures are available: Hash containers Doubly-linked lists N-ary trees Vector containers DIContainers is designed with easy customization in mind. Unlike other libraries, it strictly separates a containers' data and structure: Data describes an individual item in the container, for example an Integer number. The data layer is mostly responsible to manage the item's memory, but also for copying, comparing, and streaming of items. Data items in DIContainers are made up of memory efficient Pascal records. Special item handlers take care to initialize and finalize items automatically as required. Structure describes the arrangement of items within the container, like linked list, linear vector, etc. The structure determines how quickly items can be added, manipulated and retrieved from the container. Using different item handlers, the same structure can provide for quite different containers (see hierarchy on the right). To create a new container for some type of data, it is often sufficient to reuse an already existing item handler or to create a new item handler for the new type of data. Type. On top of the general container classes, there are many ready-made containers which interface typed access to their items like strings (WideStrings and AnsiStrings), different Number types, Objects, Pointer, and various combinations of the above. More than 100 of these containers are ready to use straight out of the box. Advanced container operations include cross-container assignment (i.e. from lists to vectors) and cascading streaming. The graphic to the right shows the class hierarchy of containers contained in DIContainers. Bold font marks important classes like item handlers and structure containers. Their descendant classes in regular font provide typed access to their items. The graphic was automatically created from the DIContainers library by one of the demo applications.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值