关于重新设计data accessing layer的思考(一)

摘要: 背景:项目中已运行10年的数据访问层,存在若干架构方面的问题,为了彻底解决并释放并行访问的能力,并提供一套完整的面向对象的API,决定重新设计。思考问题:1.如何保证兼容性: 1)使用新库的实现替代旧库中的实现,保证一次性全部修改并测试,不修改旧库的API,且提供用户新的API 2)新库与旧... 阅读全文
posted @ 2014-05-07 17:38 Tongxuan 阅读(214) 评论(0) 推荐(0)

调试器-指向异常位置

摘要: 昨天在调试一个unit test的时候,使用VS调试启动unit test,跳出错误框:First-chance exception at 0x74FAC41F (KernelBase.dll) in ××××.exe: 0x04242420 (parameters: 0x31415927, 0x5D250000, 0x0033F418).If there is a handler for this exception, the program may be safely continued.此时Call Stack:clr.dll!_EEDllUnre 阅读全文
posted @ 2014-04-10 16:02 Tongxuan 阅读(340) 评论(0) 推荐(0)

Compare diff type values

摘要: 闲来无聊,迷上了meta programming 小例子:#include using namespace std;templatestruct IsBigger{ static const bool bigger = sizeof(T1) > sizeof(T2);};templatestruct ReturnType{};templatestruct ReturnType{ typedef typename T1 valType;};templatestruct ReturnType{ typedef typename T2 valType;};templatetypename Re 阅读全文
posted @ 2014-04-01 21:16 Tongxuan 阅读(161) 评论(0) 推荐(0)

今天看到一篇关于DSL(Domain Specific Language)的文章

摘要: 休假回来,换了办公室,发现桌上放了一大堆ACM communication的杂志, 每天会挑一本看,今天注意到D. GHOSH的一篇关于DSL的文章。DSL:优点:1.与bussiness人交互更简单2.更易于表达和维护,隔离了技术细节3.领域模型接口都与实际的领域行为相关4.扩展性缺点:1.设计难,对于软件人员要深入了解领域知识2.会倾向使用多语言而导致设计的臃肿3.除非项目中等以上的复杂度,否则领域模型不能提高效率还给了个小例子。了解更多DSL在软件整个架构的位置,参见Eric的DDD的第四章。 阅读全文
posted @ 2014-04-01 20:38 Tongxuan 阅读(1102) 评论(0) 推荐(0)

Performance counter in Windows

摘要: 比较方便的性能计数方式,重点是API设计的简单和可读性。#pragma once#include #include using namespace std;using namespace chrono;high_resolution_clock::time_point time_now(){ return high_resolution_clock::now();}float time_elapsed(high_resolution_clock::time_point const & start){ return duration_cast>(high_resolution_cl 阅读全文
posted @ 2014-03-31 16:32 Tongxuan 阅读(145) 评论(0) 推荐(0)