Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Initially I started learning OOP and later started grasping concepts of Design Patterns. I wonder whether it is the Design Pattern which is the SuperSet of OOP or it is the OOP itself.

share|improve this question
add comment

2 Answers 2

up vote 11 down vote accepted

Neither.

Design patterns are just constructs to simplify communication about programming by providing a common lexicon for common code layouts (or paradigms or models or ...)

I can (and have!) write a facade or a singleton in a non-OO language.

Some have argued that design patterns are just ways to make up for feature deficiencies within the core language itself. I think that's a bit of an exaggeration, but it does help keep design patterns in their proper perspective. They're just another tool to aid in communication and design; they don't belong up on a pedestal to be worshipped.

share|improve this answer
2  
well it certainly is true that various language features can make specific design paterrns trvial –  jk. Jul 19 '12 at 11:46
    
There are patterns for which your answer is correct (see programmers.stackexchange.com/questions/67594/…), but the classic GOF book was (correctly) sub-titled "Elements of Reusable Object-Oriented Software". And if you are writing a facade or a singleton in a non-OO language, you are just doing OOP in a non-OO language, so your example is IMHO flawed. –  Doc Brown May 27 at 11:02
add comment

It is possible to program in an object oriented language without using any established design patterns, but it is not possible to use object oriented design patterns in non object oriented languages. Ergo, I'd say design patterns are a subset of OOP inasmuch as this categorization makes sense.

share|improve this answer
4  
Some patterns are OO-specific, others can be implemented just as well in imperative or functional languages. –  Joachim Sauer Jul 19 '12 at 11:59
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.