首页| 论坛| 消息
主题:Tianchi共享库设计意见征集
XChinux发表于 2013-05-07 11:04
Tianchi项目开发中(Tianchi v0.0.1:http://www.qtcn.org/bbs/read-htm-tid-53763.html),有一些设计方面的问题,需要征集大家的意见,看看采用何种方式,大家将意见写在回帖中,有足够的征集意见后,我们修改Tianchi库,发布v0.0.2

1. 为防止命名冲突,有下面两种方案, 您觉得哪种形式对于库设计来说比较合适?:
a) 定义Tianchi名字空间,比如::Tianchi::MyClass, 然后typedef ::Tianchi::MyClass TcMyClass,metaObject->className()为 "Tianchi::MyClass"
b) 定义类前缀,比如::TcMyClass,然后namespace Tianchi { typedef ::TcMyClassMyClass; }, metaObject->className()为"TcMyClass"

2. 关于文件大小写,下面两种方案,您觉得哪种设计比较合适:
a) 文件名大小写区分,比如MyClass.h、MyClass.cpp、MyClassPrivate.cpp
b) 文件名大小写不区分,如要间隔,加下划线,比如myclass.h、myclass.cpp、myclass_p.cpp

3. 是否有必要增加不包含.h的头文件,以表明类名、名字空间名等,比如

MyClass
#include // or myclass.h

TcGui
#include
#include
......
#include

4. 采用下面三种方式来使用Tianchi库,您通常采用何种方式?
a)动态库
b)静态库
c)直接使用源码(需要对Tianchi库结构有所了解)

5. 头文件使用方式,有下面几种,您觉得哪几种比较合适?(多选)
a) #include
b) #include
c) #include
d) #include
e) #include
f) #include
g) #include
h) #include

6. 对于Tianchi库中的一些目录,下面几种方案哪种比较合适?(多选)
a) src/gui/myclass.cpp
b) src/Gui/myclass.cpp
c) src/gui/MyClass.cpp
d) src/Gui/MyClass.cpp
e) include/tianchi/Gui/myclass.h
f) include/tianchi/gui/myclass.h
g) include/tianchi/Gui/MyClass.h
h) include/tianchi/gui/MyClass.h
i) include/tianchi/Gui/MyClass
j) include/tianchi/gui/MyClass
回帖(7):
7楼:引用第6楼渡世白玉于2013-05-22 15:12发表的:
另外提个意见、、、建议源码都保存为utf-8格式 ..
6楼:另外提个意见、、、建议源码都保存为utf-8格式、、、
qt-5全线转移到utf-8了,这样的确省了 ..
5楼:1. a) b)都需要, 用宏作为开关确定是否使用名字空间
2. b) 全部小写
3. 必要
4. a) ..

全部回帖(7)»
最新回帖
收藏本帖
发新帖