I've recently been introduced to the idea of design patterns (that may lead everyone to realize what a 2-bit hack I am, but that's ok), in particular, the flyweight pattern.
I'm not really a C#, Java, C++, etc professional (only web), so I've never really thought of design in such complex terms, but I can't help thinking that my PHP code could be significantly improved and simplified if I implemented better design patterns that would work best for the particular type of application I'm working on.
I was wondering if anyone uses any specific design patterns, and if so, if you had any links you could post with different PHP implementations of design patterns.
Thanks in advance.
Design Patterns
Moderator: General Moderators
-
timclaason
- Forum Commoner
- Posts: 77
- Joined: Tue Dec 16, 2003 9:06 am
- Location: WI
-
alex.barylski
- DevNet Evangelist
- Posts: 6267
- Joined: Tue Dec 21, 2004 5:00 pm
- Location: Winnipeg
Good programming practice and design, architecture, etc can be applied to *any* programming language regardless of it's purpose:
Client side JavaScript
Server side PHP
or desktop development in C++/C#/Java
I use as much as I know and as I much as I find fit for a given scenario.
If you want to know about design patterns, youv'e come to the right place, we have a few design pattern geeks on these boards.
Long story short: Use them, don't abuse them. Start simple and work your way up, don't apply every technique the minute you learn it, rather understand it's role in system design and look for future opportunities, etc.
Cheers
Client side JavaScript
Server side PHP
or desktop development in C++/C#/Java
I use as much as I know and as I much as I find fit for a given scenario.
If you want to know about design patterns, youv'e come to the right place, we have a few design pattern geeks on these boards.
Long story short: Use them, don't abuse them. Start simple and work your way up, don't apply every technique the minute you learn it, rather understand it's role in system design and look for future opportunities, etc.
Cheers
- Ollie Saunders
- DevNet Master
- Posts: 3179
- Joined: Tue May 24, 2005 6:01 pm
- Location: UK
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
I think its probably more accurate to say that the problems solved by the flyweight pattern are not frequently implemented in web applications. It is one of many techniques to reduce data duplication. The OP expressed interest in the flyweight pattern, but did not give a specific problem that needed to be solved.ole wrote:if I remember correctly, the flyweight pattern doesn't really apply to PHP.
Last edited by Christopher on Fri May 25, 2007 4:24 am, edited 1 time in total.
(#10850)
- Maugrim_The_Reaper
- DevNet Master
- Posts: 2704
- Joined: Tue Nov 02, 2004 5:43 am
- Location: Ireland
Oren plugged my site
. The contents are limited for now since I'm not in article writing mode (lack of time). Also http://www.phppatterns.com
A few article sites like DevShed run a regular design pattern series. Many focus on PHP implementations. Outside that don't be afraid to look for Java examples. The code is likely not portable but the explanations are worth reading since they apply to any language.
A few article sites like DevShed run a regular design pattern series. Many focus on PHP implementations. Outside that don't be afraid to look for Java examples. The code is likely not portable but the explanations are worth reading since they apply to any language.
-
the_drizzle
- Forum Newbie
- Posts: 17
- Joined: Fri Jun 01, 2007 11:55 am
Check out FluffyCat. It gives some general descriptions of design patterns, using PHP for code examples.