Looking for Projects having extensive usage of (mostly used) design patterns - c++

I want to get my hands dirty with some projects (in C++) which have used design patterns extensively.
I have already read design pattern documentation (as well as code) from net and other books (gang of four and Head first), but i am looking for a place where i can get already implemented projects (using design patterns), get my hands dirty with them, understand them, enhance them etc.
Could anybody point me to a place(s) from where I can get design experience in the best possible way? (Please note: Language C++, Complexity of the project can be intermediate to difficult)

ACE is a good example - uses many concurrency and communications patterns. There's a list of related tutorials on their website here.
If you are feeling ambitious take a look at Loki.

Related

javascript list manipulation library/framework

I'm looking for a javascript library/framework to manipulate lists. Is there anything like this already out there?
Ideally I'd like something equivalent to .NET's List. One of the main requirements is the ability to remove items from anywhere in a list. Some LINQ-like functionality would be great.
Underscore.js
It's not a substitute for a completely functional List replacement, but:
it does get you a long way,
it's well designed,
well documented (and has a very nicely "literate-programming"-style annotated source),
easy to extend,
lightweight.
It has a nice expressiveness and power to memory footprint ratio.
(Note that is was inspired by the two following libraries, FunctionalJS and Data.js.)
FunctionalJS
It shares most of Underscore.js's attributes, and is definitely more oriented towards functional programming. However:
it is less actively maintained,
it is slightly harder to use if you're not familiar with functional concepts.
Data.js
More than a purely functional programming library like FunctionalJS, Data.js also covers storage aspects, graph-like data-structures and other goodies.
(It is funny to note that Data.js now lists Underscore.js has an influence in its newer iteration, while Underscore.js already lists Data.js as its own influence.)
List.js
List.js is for manipulating HTML lists. It may not be what you want, but I thought of adding it here as well as it does its job very well and fits a nice niche in terms of briding data and UI management in one (not necessarily a good idea, but works for some cases).
Others...
Dojo (and many other JS libraries nowadays) supports some of the newer JS APIs or provides substitute implementations if they are missing, with some of them fairly functional by nature and design.
However, they don't push the concept quite as far, and these libraries are more heavyweight, so I wouldn't recommend them if that's all you want out of them.
jLinq, as mentioned by JanusTroelsen in your question's comments, looks very promising as well but I would be more concerned about the maturity of the library and its memory footprint for what it is (but the code seems very "spaced", so a compressed version might be acceptable).
May linq.js what you're looking for ? http://neue.cc/reference.htm
Also, http://microjs.com/ is a good site to find a library corresponding to a specific need :)
Also you can try manipula package that implements all of C# LINQ methods and preserves its syntax:
https://www.npmjs.com/package/manipula

C++ libraries for web ranking and search engines

Can anybody introduce me some libraries that contains web ranking algorithms such as PageRank, HITS?
Thank you
I guess you are refering to the canonical PageRank algorithm as published in the original PageRank paper. People nowadays use "PageRank" to refer to the actual current Google algorithm for search.
If that is really the case, the PageRank implementation is not that difficult to find and use. Searching through Google you can find a good deal of implementations. One in python, for example.
For the HITS algorithm there's pseudocode in wikipedia. There's also a Perl implementation.
I'm also suggesting CLucene for you to start messing around.
Unless you work for Google, there aren't many good ways of finding out the specifics of their page ranking algorithm...which changes from time to time. Wikipedia outlines some of the basics:
http://en.wikipedia.org/wiki/PageRank
Other people write lengthy articles:
http://www.smashingmagazine.com/2007/06/05/google-pagerank-what-do-we-really-know-about-it/
If you are interested in the kinds of techniques that are involved in writing a search engine, there are several topics. For instance, there is "web crawling" and how to write programs that visit web sites and grab their contents...and determining when to visit the sites again to see if they've changed:
http://en.wikipedia.org/wiki/Web_crawler
Once you have a bunch of data on your machine(s) to analyze and search, the subject area to study is called "Information Retrieval" (or "IR"):
http://en.wikipedia.org/wiki/Information_retrieval
It's a fairly new science, but a lot of work is done on it. Wikipedia has a list of "free search engine software":
http://en.wikipedia.org/wiki/Category:Free_search_engine_software
I'd suggest that if you're new to this then it might be best to start with figuring out how to use something like Lucene to provide a search box on a website you have. Then dig in and see how it works. It has been ported to C++ if that is important to you:
http://clucene.sourceforge.net/

Importance of a design pattern?

I am learning C++
I don't know much about this stuff except the fact that programming design pattern is neccesary when actually working in large projects.I hope its correct to some extent.
Is this common to all object oriented languages or do I need to look specifically into
C++ design patterns.
Also How does it helps you.Is this realy important to learn as a C++ programmer.
Please suggest
Design patterns are often misunderstood. They are really a way for experienced users to have shorthand for describing common situations. You don't need to worry about them too much while you are learning C++.
You will hear discording opinions about design patterns, in the programming community at large.
In my opinion, it is sure that there are abstractions that patterns encapsulate that are really useful (factory, singleton, delegate, etc.). I use patterns a lot, but I myself am sometime puzzled by the apparent lack of depth or level of insight that you get by reading a pattern description. This is also in tune with the proliferation of design patterns that specialize for any kind of things.
When the design hey are useful, they are a very good means of communication and certainly they guide you through the process of designing or defining the architecture of your app. They are useful both for small project and for large ones, and they can be applied at different granularity levels.
Patters are a generic concept and all programming languages support them. Anyway, if you work in C++, a book focusing on it is best, because you will get the pattern adapted to the characteristics of the language.
In my opinion, the really fundamental book about design patterns are:
GoF, Design Patterns: Elements of Reusable Object-Oriented Software
VV.AA., Pattern-Oriented Software Architecture Volume 1: A System of Patterns
VV.AA., Pattern-Oriented Software Architecture Volume 2: Patterns for Concurrent and Networked Objects
Most of the design pattern are common to all object oriented languages.
For me design patterns are nothing but abstractions that shorten communication time between programmers. Instead of expressing a complex idea of how your program is designed, you can probably find a name of a pattern that describes the design of your program.
E.g. TPM says "We should use singleton here", and you interpret "We should use one instance of the class here".
Patterns are useful to learn, but one can program without knowing any patterns, yet using them a lot.
I see design patterns as collections of wisdom gained by experience, particularly addressing issues of flexibility and maintainability of code. For example: by using a facade we can change implementations without changing the code that uses the facade.
I think it's fair to say that all programming languages have wisdom to be captured, and design patterns of some sort will be useful. The C/C++/Java/C# heritage languages seem to offer a particularly rich seem to be mined for wisdom. C++ being quite gnarly really does benefit from some key design patterns.
Some folk see Design Patterns as a way of patching over language deficiencies, that would imply that "better" langauges might need fewer patterns. My feeling is that in all cases we have something to learn from experienced folks and Patterns help us codify their wisdom.
Edited to add: Interesting point made by Munish, it is best to do a little reinvention first? By writing some real code without explicit use of Patterns you may well start to feel dissatisfied with what you write ... when I change this, I need to change all that, is there a better way to write this? ... this may drive you to really need patterns and hence motivate your study.
If you have the luxury of time to learn this way then I think you'll probably benefit.
Design patterns are solutions to commonly occuring problems in Design phase of a project.These patterns provide the solutions which we can use independent of programming language.For e.g. there is Singleton design pattern which ensures that there is only one instance of a class.Now there are numerous occaions on which this may be required.You can use the solution of these pattern and use in your code.
They provide the re usability in Software development .Put simply, design patterns
help a designer get a design right faster.
For more better understanding you could refer Design Patterns: Elements of Reusable Object-Oriented Software

Symptoms and alternatives to overused OOP

Lately I am losing my trust in OOP. I have already seen many
complaints about common OOP misuses or just simple overuse. I do not
mean the common confusion between is-a and has-a relationship. I mean
stuff like the problems of ORM when dealing with relational databases,
the excessive use of inheritance from C# and also several years of looking
at code with the same false encapsulation belief that Scott Meyers
mentions in the item 23 of Effective C++
I am interested in learning more about this and non OOP software
patterns that can solve certain problems better than their OOP
counterparts. I am convinced that out there there are many people
giving good advice on how to use this as an advantage with non pure OOP
languages such as C++.
Does anyone knows any good reference (author, book, article) to get
started?
Please, notice that I am looking for two related but different things:
Common misuses of OOP concepts (like item 23)
Patterns where OOP is not the best solution (with alternatives)
Well I can recommend you a book Agile Principles, Patterns, and Practices in C#.
Examples are in C# of course, but the idea of the book is universal. Not only it covers Agile but also focuses on bad practices and shows in examples how to convert bad code to a good code. It also contains descriptions of many design pattern and shows how to implement them in semi-real example of Payroll application.
This has to be done but if you truly want to get away from OOP or at least take a look at concepts which are not OOP but are used with great effectiveness: Learn you a Haskell. Try a new programming paradigm and then start seeing where you can apply much of the concepts back to OOP languages. This addresses your second bullet, not in a direct way but trust me, it'll help more than you can think.
It's a bit odd that you mention C#. It has very powerful keywords to keep the usual inheritance misery in check. The first one ought to be the internal keyword. The notion of restricting the visibility to a module. That concept is completely absent in C++, the build model just doesn't support it. Otherwise a great concept, "I only trust the members of my team to get it right". Of course you do.
Then there's the slammer one, the sealed keyword. Extraordinary powerful, "the buck stops here, don't mess with me". Used with surgical precision in the .NET framework, I've never yet found a case where sealed was used inappropriately. Also missing in C++, but with obscure ways to get that working.
But yes, the WPF object model sucks fairly heavy. Inheriting 6 levels deep and using backdoors like a dependency property is offensive. Inheritance is hard, let's go shopping.
I would say to look at game engines. For the most part, OOP has a tendency to cause slight performance decreases, and the gaming industry is seemingly obsessed with eliminating minor slowdowns (and sometimes ignoring large ones). As such, their code, though usually written in a language that supports OOP, will end up using only those elements of OOP that are necessary for clean code / ease of maintenance that also balances performance.
EDIT:
Having said that, I don't know if I would really go look at Unreal. They do some strange things for the sake of making their content pipeline easier for developers... it makes their code... well, look if you really want to know.
One common overuse is forcing OOP in programs/scripts that take some input, turn it to output, then exit (and not receiving input from anywhere else during the process). Procedural way is much cleaner in these cases.
Typical example of this is forcing OOP in PHP scripts.

state-of-the-art C++ projects

I like to go through existing software projects as a source of learning and new ideas.
doing so I discover things that I did not think were possible
in your opinion, what is the top state of the art C++ project that you have used/develop/extended? can you state reasons why you consider it state of the art and what you can learn from it.
my latest craze is boost::phoenix, http://www.boost.org/doc/libs/1_43_0/libs/spirit/phoenix/doc/html/index.html, which is very comprehensive functional programming library.
Despite its capabilities it is straightforward and easy to extend. After some tweaking I was able to write multithreaded lambda parallel loops and mathematical domain specific language, probably within 2 weeks.
What is yours? (please do not just say boost, as it is huge collection of project)
Personally, I like to look at code in Qt. I do use it everyday, but it seems like every day I use it, I find something new. In terms of total code, it is probably as big as boost. But it comes with excellent documentation and examples and complete source code and is free for LPGL & GPL versions.
For me, what I liked about Qt was that it's concepts matched the way C# works, so it was a fairly easy transition back into c++ for me. But by looking at their code, it has really given me many ways (although not as many as SO) to understand some of the complexity in C++
From what I've seen, the code-sources that I have learned the most from have been from fairly complex 3rd party software libraries. Havok is an excellent example from which I've not only learned programming practices and solutions, but also quite a few mathematical and philosophical discussions. I've also seen some other code-sources which have not been open sourced from which I've learned how to not solve things.
Game engines for AAA-titles in general tend to involve a lot of complex code that tries to push as much as possible through a piece of hardware. I guess that the recommendation goes for all software that tries to achieve something similar but I've only dived into game engines when it comes to such software. AAA-titled game engines often have good or bad solutions to study and I would generally recommend looking into those. There are some that are open source... I think Source/Valve have released theirs in different stages.