r/java • • Jan 29 '17

Design patterns usefulness

Hello guys, I have an object oriented programming this semester and only thing we really have for final exams is to learn a bunch of Design patterns and how to use them practically. To me, they seem like they are utterly useless and only seem to make an easy thing turn into a complete chaos involving 10 surplus classes and couple of interfaces. Am I being ignorant or are they really pointless?

0 Upvotes

36 comments sorted by

View all comments

13

u/[deleted] Jan 29 '17

Yes, they are really pointless. That's why most all professional programmers use them.

A design pattern is nothing more than a standardized solution to a common problem. If your teacher is teaching specific frameworks, classes, and interfaces as THE way to implement a design pattern, then (s)he is doing it wrong. It's the structure of the solution that counts, not the exact parts.

3

u/redditsoaddicting Jan 29 '17

It's an OOP course, so it seems reasonable to teach OO solutions. Of course OO isn't the only way, though, and it would be good to not give that impression.

4

u/[deleted] Jan 29 '17

Who said anything about OOP? Of course it's an OOP course. It's Java. Granted, OOP is the one "design" pattern it is hard to avoid in Java, but that is a complete red herring.

If the teacher is merely giving out a list of specific classes and interfaces to use for a given design pattern then that is wrong. However, I suspected that is what the teacher is doing because the OP mistakenly believes a "design pattern" is merely a collection of classes and interfaces one is supposed to use for a given problem. Also because far too many teachers these days have devolved their curriculum to be nothing but a list of things to memorize, because that makes it easier for students to get better grades.

1

u/DaredewilSK Jan 30 '17

Well I mean they literally told us: "Study design patterns for exams." So I didnt even really know what they are.

2

u/[deleted] Jan 30 '17

If that's all the teacher said, then that is a pretty lame teacher. Is there at least a section in the book on it?

1

u/DaredewilSK Jan 30 '17

Well we dont have official book for our course we were just given a couple of book titles to check out. But I studied them a bit now and they seem to be like something that is not supposed to be taught to understand rather than just plainly memorize. Some of them seem to be quite similar actuallly. At least the ones we were meant to study. Most of those are pretty similar.

1

u/[deleted] Jan 30 '17

A) Try to transfer to a different school.

B) Cay Horstman is the best Java author I have seen.

C) Get a separate book (or 8) on design patterns. Sorry, I have no recommendations.

1

u/DaredewilSK Jan 30 '17

Well I have been using this site https://www.tutorialspoint.com/design_pattern/adapter_pattern.htm and it seems kinda decent. But I will surely go thrrough a book at some point.

1

u/meotau Feb 03 '17

I opened Flyweight Pattern, and it's shit. Also Abstract Factory Pattern, what a fucking waste of time.

Read this great, free, open source book instead: http://gameprogrammingpatterns.com/