Register | Login
Views: 19364387
Main | Memberlist | Active users | ACS | Commons | Calendar | Online users
Ranks | FAQ | Color Chart | Photo album | IRC Chat
11-02-05 12:59 PM
0 user currently in Programming. | 3 guests
Acmlm's Board - I2 Archive - Programming - Design Patterns
  
User name:
Password:
Reply:
 

UserPost
rg_
Posts: 1/26
In my opinion there are two major advantages that come from using design patterns in your code.

The first one is that you don't have to think about how to implement certain things. If you know your design patterns well you will instantly know how to write code for certain situations. If you have to implement something like a directory structure for example you don't have to think about the general structure of your data first, unless there's something very non-standard about your directory structure you can instantly think "Composite pattern" and you know what to code. Even better is that all the common patterns are well-tested, well-documented and well-understood. If you write your own solution instead of choosing appropriate design patterns neither of these three advantages will be true at first.

The second huge advantage is that you have names for quite complicated class structures adding an extra level of abstraction. When you write a GUI and want to explain it to someone like your co-worker or teacher or whoever you don't have to start giving huge explanations, possibly drawing diagrams how your classes interact with each other. Instead of saying "Well, I have these three classes here. One is for displaying the GUI elements, one keeps track of the underlying data and one is used to modify the data in a way that keeps the data consistent; here are pictures how they cooperate" you can just say, "three classes; standard MVC pattern" and the other person knows (or should know) how you structured your code.

Also, don't worry about forgetting design patterns after going back to functional programming again. Even though OOP design patterns are probably the most popular ones there are design patterns for virtually all aspects of programming. After all a design pattern is not much more than a formalized way of programming something that has been proven to work very well over the years. I'm not an expert on functional programming but I'm sure if you hit Google you'll find design patterns for functional programming too.
windwaker
Posts: 1601/1797
I've heard of them, yet I have yet to grasp the art of doing so. What really is using this to speed up code?
neotransotaku
Posts: 3060/4016
I've learned them--I haven't used them yet in my software engineering career. I know they help you generate a general solution to your problem but I haven't really applied it to any other class. I have yet to start working so I dunno how much it is used there.
Ramsus
Posts: 63/162
Anyone else know what I'm talking about? I'm reading a book on them, thanks to all of the thousands of free books available at my university's engineering library. I've been using object oriented programming lately, and this really clears up my thinking on designing a current project I'm planning on doing in PHP. It's all kind of obvious on some level (everyone uses or has used at least a few), but it adds a new sense of clarity I think.

Anybody want to comment on their experiences with design patterns?

I think they're great, but after I finish this current project I'm going back to studying functional programming, macros and Common Lisp.
Acmlm's Board - I2 Archive - Programming - Design Patterns


ABII


AcmlmBoard vl.ol (11-01-05)
© 2000-2005 Acmlm, Emuz, et al



Page rendered in 0.002 seconds.