On Fri, Apr 21, 2017 at 09:01:09AM +0200, Tommaso Cucinotta wrote: > On 21/04/2017 05:51, Scott Kostyshak wrote: > > (1) studying design patterns is a reasonable way to achieve that goal > > (2) what the best way to do that would be > > I have good memories of Bruce Eckel's Thinking in C++ > > http://www.mindviewinc.com/Books/downloads.html > > there's a whole chapter about design patterns, plus plenty of good hints on > C++ software design. > > > (3) which design patterns we use in LyX > > those that you can see "all over the place" (I show some of these LyX > examples in my lecture on DP :-) ): > -) singleton (e.g., LyX.cpp) > -) factory (e.g., MathFactory.cpp) > -) MVC / MV (the whole src/frontends/qt4/*.cpp vs src/*.cpp code separation > structure > -) observer: see how GuiView(s) track changes in Text/Buffer/Inset(s) > -) private implementation (just grep for impl_) > -) template pattern: grep 'do[A-Z]' src/*.cpp > -) visitor & double-dispatching: serialization/deserialization to/from file, > e.g., grep 'write' src/insets/*.h > -) composition: the whole Buffer, Paragraph, Inset, etc... > -) iterator: well, quite a lot of stc++, but also e.g. the very DocIterator, > as well as e.g.: Inset::idxNext() / ::idxPrev(); basically, grep -r > 'prev\|next' * > -) I can barely remember the moment boost::signal<> was dropoped, years ago, > that was enlightning... > > Not that all of the above cases are completely & fully adhering to a DP full > spec, however, there's quite many bits here & there... > > My2c,
This is all very useful. This gives me a good start for studying. Thanks, Tommaso! Scott
signature.asc
Description: PGP signature