Lately I have been learning some Design Patterns. And I was wondering where all its used in Qt.
For example,
1. Observer Pattern in Signals and Slots.
2. Iterator in QList.
Could anyone tell me about other patterns.
Printable View
Lately I have been learning some Design Patterns. And I was wondering where all its used in Qt.
For example,
1. Observer Pattern in Signals and Slots.
2. Iterator in QList.
Could anyone tell me about other patterns.
Not really sure about the observer, but i just finished reading up on iterators for QList...
QList has an STL-style iterator, accessible like so:
Code:
QList<Type> list; //the list QList<Type>::iterator i; for (i = list.begin(); i != list.end(); i++) Type item = *i;
There is also a QListIterator-class which is more Java-style...like so:
Code:
QList<Type> list; //the list QListIterator<Type> i(list); while (i.hasNext()){ Type item = i.next(); }
:D
All of Interview is written using the Model - View pattern. There are quite a few patterns out there and signals/slots makes it easy to interconnect Qt classes according to different patterns with minimal fuzz.
Quote:
Originally Posted by bits
Signals/Slots is more of a Publish/Subscribe pattern ... using an intermediary ... such that there is no coupling between the sender and receiver. The Observer pattern requires the sender and receiver to know more about each other.
Apropos this topic, there is a new Qt book coming out in September called "An Introduction to Design Patterns in C++ with Qt 4", by Alan and Paul Ezust.
I couldn't find much information over this Publish/Subscribe pattern.Quote:
Originally Posted by brcain
Can any one recommend any link where we can find more about this?
Thanks for the info. I assume it will be a great book to start with.Quote:
Originally Posted by Brandybuck
I think that this book will definitely help us make our designs better.
http://www.eventhelix.com/RealtimeMa...e_patterns.htmQuote:
Originally Posted by bits
is the ebook of "Introduction to Design Patterns in C++ with Qt 4" available?
wysota,
the link you given is a hard copy of book, I dont think that is e-book.
have any one read "Introduction to Design Patterns in C++ with Qt 4"?
is this book are really good?
I read sample chapter 9.
Oh, I missed the 'e' character in your post :) You can access parts of the books online, AFAIR, but not all of it.