Rob 的个人资料Software.照片日志列表更多 ![]() | 帮助 |
|
|
8月6日 The factory pattern.After reading a few explanations of the factory design pattern and viewing some not so simple examples i thought id try an explain it.
Why use it?
Flexible code and can be used to encapsulate code if the creation of an object is complicated.
Psuedo code example shows how it might be used in a cross platform graphics library.
class GenericFactory
{ GenericFactory * getFactory() { if(MyOs() == Windows) return(new WindowsFactory); if(MyOs() == Linux)
return(new LinuxFactory); } virtual void drawbutton();
}; class WindowsFactory:GenericFactory
{ drawbutton() { Do some windows specific stuff } }; class LinuxFactory:GenericFactory
{ drawbutton() { Do some Linux specific stuff } }; int main()
{ GenericFactory genfactory ; GenericFactory * Factory = genfactory.getFactory();
Factory.drawButton(); } 8月4日 Task explorerSimilar to windows Task Manager but with extra features:
8月3日 File hunterFile hunter is a file search utility written in Java. Designed to run on both on Windows + Linux. Supports entering a regular expression as search criteria. See: http://www.regular-expressions.info/ 4月3日 StrikeStrike is a windows based IRC bot. Written in C++, winsock. Features: Can administrate multiple rooms. Can easily be configured using the editor. Secure user authentication system. DartDart is a simple game written in c++. Features collision detection and animation. |
|
|