Menu

#3 Signals and sockets

open
nobody
None
5
2011-01-18
2011-01-18
No

An idea to use singleton to store and retrieve configuration is not so good as I thought. Using of Singleton breaks all benefits of OOP. Using of singleton is such the same evil as using global variables.
So I decided to build my project with help of signals. So, for example, if user will press a key - then the window which is in focus will emit signal, and some class that is responsible for input will check, whether the user pressed a right key and will emit appropriate signal. Then, marquee widget will process the signal and will move cursor one character right. At the same time, another object, which is responsible for statistics will process the signal and will do what it must.
The marquee widget will listen to socket and read characters from it. At another end will sit conveyer-object which will put characters into socket.

Discussion


Log in to post a comment.

MongoDB Logo MongoDB