This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Ruby and the fly likes What is an Anti pattern? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Languages » Ruby
Bookmark "What is an Anti pattern?" Watch "What is an Anti pattern?" New topic

What is an Anti pattern?

Praful Gupta
Ranch Hand

Joined: May 01, 2006
Posts: 70
What is an Anti pattern as compared to say design patterns in general and are they unique only to Rails?
Greg Funston
Ranch Hand

Joined: Feb 09, 2011
Posts: 81

In software engineering, an anti-pattern (or antipattern) is a pattern that may be commonly used but is ineffective and/or counterproductive in practice.

Greg Funston SCJP
Greg Funston
Ranch Hand

Joined: Feb 09, 2011
Posts: 81

Congrats on what looks like a fine book for users of the Ruby framework. I look forward to reading it sometime.

Greg Funston SCJP
Jan de Boer
Ranch Hand

Joined: Dec 10, 2010
Posts: 348
Praful Gupta wrote:are they unique only to Rails?

Well design patterns are generally mostly language independant, so anti patterns probably are simular I think, right?

Sumit Bisht
Ranch Hand

Joined: Jul 02, 2008
Posts: 329

Yes, loosely speaking, anti-pattern is something that is routinely done in a wrong manner. For example beginners learning struts or php coders coming into Rails frequently write scriptlets because they seem more powerful/easy for their tasks.

Thus, anti-patterns are opposite of design patterns when it comes to applicability. DPs provide a guidemap for development/learning whereas anti-DPs educate us on common pitfalls in development.
As rails packs with itself a lot of stuff under the hood, like MVC, ORM & RESTful architecture, we frequently find ourselves having a poor or non-eloquent design. Here's when books like these help you out.
I agree. Here's the link:
subject: What is an Anti pattern?
Similar Threads
Being able to see solutions
Refactoring to Patterns - reader questions
Can we have a list of J2EE patterns:
AOP Patterns
simplest singleton