473,321 Members | 1,877 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,321 software developers and data experts.

Patterns, in general

I'm just getting up to speed on OOP patterns (e.g, MVC) and I'm wondering
how closely they are followed out in the real world. Do those of you who use
them try to follow them as closely as possible and deviate only as
necessary? Or do you only generally follow them; mix-n-match as necessary?

Just wondering what I should be looking to accomplish with OOP patterns in
general.

Thanks!
Jan 27 '06 #1
12 1873
> I'm just getting up to speed on OOP patterns (e.g, MVC) and I'm
wondering how closely they are followed out in the real world. Do
those of you who use them try to follow them as closely as possible
and deviate only as necessary? Or do you only generally follow them;
mix-n-match as necessary?

Just wondering what I should be looking to accomplish with OOP
patterns in general.

Thanks!


Design patterns followed in the "real world"? That's funny.

Seriously though. A design pattern is like a shared vocabulary. You should
try to make your code understandable to other devs as much as possible. Of
course, that's pretty tough to do all the time. I would say to deviate only
if necessary. But, necessary is so relative....ahh. screw it. It's Friday.

I'm going to the drag strip... :) ::rock::
Jan 27 '06 #2
Patterns are good because they help you solve problems in an elegant way
that's extensible (provided other developers you work with "buy in" to the
concept).

I think MVC is probably a bit advanced for starters. But any of the 20 or so
"basic" patterns such as Abstract Factory, Singleton, Decorator, Facade,
Flyweight, Mediator etc. are good to study and start to "work into" your
overall approach to solving "real world" business problems with code.

My 2 cents.

Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Jeff" wrote:
I'm just getting up to speed on OOP patterns (e.g, MVC) and I'm wondering
how closely they are followed out in the real world. Do those of you who use
them try to follow them as closely as possible and deviate only as
necessary? Or do you only generally follow them; mix-n-match as necessary?

Just wondering what I should be looking to accomplish with OOP patterns in
general.

Thanks!

Jan 27 '06 #3
I dont know if you can really say if people "follow" them or "generally" use
them because they are more outlines of how certain things should be
organized but not really implemented (language specific that is.) Now, if
you are asking if people actually use them in the real world then that is a
different story. I would think that more and more people and companies are
moving toward some sort of pattern system when they develop new
applications. Patterns and reusability go great together when done correctly
and companies should want to have code that can be reused as much as
possible.

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Charles Cox
VC/VB/C# Developer
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

"Jeff" <A@B.COM> wrote in message
news:uP**************@TK2MSFTNGP11.phx.gbl...
I'm just getting up to speed on OOP patterns (e.g, MVC) and I'm wondering
how closely they are followed out in the real world. Do those of you who
use them try to follow them as closely as possible and deviate only as
necessary? Or do you only generally follow them; mix-n-match as necessary?

Just wondering what I should be looking to accomplish with OOP patterns in
general.

Thanks!

Jan 28 '06 #4
At the minimum I think you should strive to separate out the application
logic
(Model) from the presentation/event handling.. What I have called M-VC
or what
Unix people call INTERFACE-ENGINE.

Regards,
Jeff

*** Sent via Developersdex http://www.developersdex.com ***
Jan 28 '06 #5
Ant
Hi,
Where can I find information about patterns? Any good books anyone can
recomend? Cheers.

Ant

"Peter Bromberg [C# MVP]" wrote:
Patterns are good because they help you solve problems in an elegant way
that's extensible (provided other developers you work with "buy in" to the
concept).

I think MVC is probably a bit advanced for starters. But any of the 20 or so
"basic" patterns such as Abstract Factory, Singleton, Decorator, Facade,
Flyweight, Mediator etc. are good to study and start to "work into" your
overall approach to solving "real world" business problems with code.

My 2 cents.

Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Jeff" wrote:
I'm just getting up to speed on OOP patterns (e.g, MVC) and I'm wondering
how closely they are followed out in the real world. Do those of you who use
them try to follow them as closely as possible and deviate only as
necessary? Or do you only generally follow them; mix-n-match as necessary?

Just wondering what I should be looking to accomplish with OOP patterns in
general.

Thanks!

Jan 28 '06 #6

Hi Ant,

"Design Patterns in C# by Steven John Metsker, Addison Wesley" covers 23
of the most prevalent patterns in detail.
There is a brief discussion of the useage of some of them in "Dissecting
a C# Application - Inside SharpDevelop, Apress".

HTH
Mark
Jan 28 '06 #7
Ant
Thank you Mark,
Ant

"Mark Carew" wrote:

Hi Ant,

"Design Patterns in C# by Steven John Metsker, Addison Wesley" covers 23
of the most prevalent patterns in detail.
There is a brief discussion of the useage of some of them in "Dissecting
a C# Application - Inside SharpDevelop, Apress".

HTH
Mark

Jan 28 '06 #8
http://www.dofactory.com/Patterns/Patterns.aspx

"Ant" <An*@discussions.microsoft.com> wrote in message
news:09**********************************@microsof t.com...
Hi,
Where can I find information about patterns? Any good books anyone can
recomend? Cheers.

Ant

"Peter Bromberg [C# MVP]" wrote:
Patterns are good because they help you solve problems in an elegant way
that's extensible (provided other developers you work with "buy in" to
the
concept).

I think MVC is probably a bit advanced for starters. But any of the 20 or
so
"basic" patterns such as Abstract Factory, Singleton, Decorator, Facade,
Flyweight, Mediator etc. are good to study and start to "work into" your
overall approach to solving "real world" business problems with code.

My 2 cents.

Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Jeff" wrote:
> I'm just getting up to speed on OOP patterns (e.g, MVC) and I'm
> wondering
> how closely they are followed out in the real world. Do those of you
> who use
> them try to follow them as closely as possible and deviate only as
> necessary? Or do you only generally follow them; mix-n-match as
> necessary?
>
> Just wondering what I should be looking to accomplish with OOP patterns
> in
> general.
>
> Thanks!
>
>
>

Jan 28 '06 #9
Examples of some patterns built around search algorithms (with free C# code)
can be found at http://www.frontiernet.net/~fredm/dps/Contents.htm .
However, you should probably start with the more basic patterns as discussed
in this thread.

"Jeff" <A@B.COM> wrote in message
news:uP**************@TK2MSFTNGP11.phx.gbl...
I'm just getting up to speed on OOP patterns (e.g, MVC) and I'm wondering
how closely they are followed out in the real world. Do those of you who
use them try to follow them as closely as possible and deviate only as
necessary? Or do you only generally follow them; mix-n-match as necessary?

Just wondering what I should be looking to accomplish with OOP patterns in
general.

Thanks!

Jan 28 '06 #10
"Jeff" <A@B.COM> wrote in message
news:uP**************@TK2MSFTNGP11.phx.gbl...
I'm just getting up to speed on OOP patterns (e.g, MVC) and I'm wondering
how closely they are followed out in the real world. Do those of you who
use them try to follow them as closely as possible and deviate only as
necessary? Or do you only generally follow them; mix-n-match as necessary?

Just wondering what I should be looking to accomplish with OOP patterns in
general.

Thanks!


Jeff the terminology can get a bit overloaded here:

There are good design principles (Try to minimize coupling between the model
and its presentation) and patterns which represents common ways of
implementing those design principles (MVC)

Often the pattern becomes synonymous with the principle because there may
only be one pattern that supports the principle well or simply because a
pattern name is shorter than a description of the principle that it
embodies.

The problem is that you may well focus on the pattern rather than the
principle and have no understanding of why you are using it.

Some design principles are supported by several patterns and some patterns
support several principles.

Good pattern books always explain why the pattern is used (often called the
motivation) and when and when not to use it.

I find a lot of people these days seem to just throw patterns at a problem
without sufficient thought or any consideration of possible alternatives.

A good thing to remember is the thinking of the "founder" of the idea of
design patterns (who was actualy an architect) - The design patterns that we
use in the solution are the complement, inverse or mirror image of patterns
in the problem - there is a duality. This shows both the strengths and teh
weakness of patterns - A problem can be solved by a bunch of familiar, well
known design patterns ONLY if it is a familiar, well known problem. Since
all interesting programs solve new problems it follows that no interseting
program can rely solely on patterns.

Finally, The main value of patterns is in having a shared vocabulary and
frankly there are way too many patterns and dialects for that to work as
well as we would wish. If you want to be universally understood then stick
to the bible ("Design Patterns" by Gamma et al). [This doesn't mean that you
shouldn't read other books - just don't expect everyone else to know the
pattern names]
Jan 28 '06 #11
I think Nick spoke well below but just wanted to add 2 cents...

Don't overdo it!

I've seing coders being so hooked on patterns that they think they must be
used everywhere and everytime. Coders that just have to have a abstract
factory that returns some factory that gives you a adapter that maps to 10
classes in some MVC-style system.

While all that was required was a Console.WriteLine("Hello World!")

I would also recommend reading about antipatterns.

If you're going to know about the Factory-, Listener-, Front-Controller- and
the Monitor-pattern, I think you should read some about Lava Flow, The Blob,
Poltergeists and Spaghetti Code as well.

More info here:

http://www.serve.com/hibc/briefing/index.htm

Happy Coding
- Michael S
"Nick Hounsome" <nh***@nickhounsome.me.uk> wrote in message
news:DY******************@fe1.news.blueyonder.co.u k...
"Jeff" <A@B.COM> wrote in message
news:uP**************@TK2MSFTNGP11.phx.gbl...
I'm just getting up to speed on OOP patterns (e.g, MVC) and I'm wondering
how closely they are followed out in the real world. Do those of you who
use them try to follow them as closely as possible and deviate only as
necessary? Or do you only generally follow them; mix-n-match as
necessary?

Just wondering what I should be looking to accomplish with OOP patterns
in general.

Thanks!


Jeff the terminology can get a bit overloaded here:

There are good design principles (Try to minimize coupling between the
model and its presentation) and patterns which represents common ways of
implementing those design principles (MVC)

Often the pattern becomes synonymous with the principle because there may
only be one pattern that supports the principle well or simply because a
pattern name is shorter than a description of the principle that it
embodies.

The problem is that you may well focus on the pattern rather than the
principle and have no understanding of why you are using it.

Some design principles are supported by several patterns and some patterns
support several principles.

Good pattern books always explain why the pattern is used (often called
the motivation) and when and when not to use it.

I find a lot of people these days seem to just throw patterns at a problem
without sufficient thought or any consideration of possible alternatives.

A good thing to remember is the thinking of the "founder" of the idea of
design patterns (who was actualy an architect) - The design patterns that
we use in the solution are the complement, inverse or mirror image of
patterns in the problem - there is a duality. This shows both the
strengths and teh weakness of patterns - A problem can be solved by a
bunch of familiar, well known design patterns ONLY if it is a familiar,
well known problem. Since all interesting programs solve new problems it
follows that no interseting program can rely solely on patterns.

Finally, The main value of patterns is in having a shared vocabulary and
frankly there are way too many patterns and dialects for that to work as
well as we would wish. If you want to be universally understood then stick
to the bible ("Design Patterns" by Gamma et al). [This doesn't mean that
you shouldn't read other books - just don't expect everyone else to know
the pattern names]

Jan 28 '06 #12
Awesome! Thanks guys! (everybody who responded)

"Michael S" <no@mail.com> wrote in message
news:uM*************@TK2MSFTNGP12.phx.gbl...
I think Nick spoke well below but just wanted to add 2 cents...

Don't overdo it!

I've seing coders being so hooked on patterns that they think they must be
used everywhere and everytime. Coders that just have to have a abstract
factory that returns some factory that gives you a adapter that maps to 10
classes in some MVC-style system.

While all that was required was a Console.WriteLine("Hello World!")

I would also recommend reading about antipatterns.

If you're going to know about the Factory-, Listener-, Front-Controller-
and the Monitor-pattern, I think you should read some about Lava Flow, The
Blob, Poltergeists and Spaghetti Code as well.

More info here:

http://www.serve.com/hibc/briefing/index.htm

Happy Coding
- Michael S
"Nick Hounsome" <nh***@nickhounsome.me.uk> wrote in message
news:DY******************@fe1.news.blueyonder.co.u k...
"Jeff" <A@B.COM> wrote in message
news:uP**************@TK2MSFTNGP11.phx.gbl...
I'm just getting up to speed on OOP patterns (e.g, MVC) and I'm
wondering how closely they are followed out in the real world. Do those
of you who use them try to follow them as closely as possible and
deviate only as necessary? Or do you only generally follow them;
mix-n-match as necessary?

Just wondering what I should be looking to accomplish with OOP patterns
in general.

Thanks!


Jeff the terminology can get a bit overloaded here:

There are good design principles (Try to minimize coupling between the
model and its presentation) and patterns which represents common ways of
implementing those design principles (MVC)

Often the pattern becomes synonymous with the principle because there may
only be one pattern that supports the principle well or simply because a
pattern name is shorter than a description of the principle that it
embodies.

The problem is that you may well focus on the pattern rather than the
principle and have no understanding of why you are using it.

Some design principles are supported by several patterns and some
patterns support several principles.

Good pattern books always explain why the pattern is used (often called
the motivation) and when and when not to use it.

I find a lot of people these days seem to just throw patterns at a
problem without sufficient thought or any consideration of possible
alternatives.

A good thing to remember is the thinking of the "founder" of the idea of
design patterns (who was actualy an architect) - The design patterns that
we use in the solution are the complement, inverse or mirror image of
patterns in the problem - there is a duality. This shows both the
strengths and teh weakness of patterns - A problem can be solved by a
bunch of familiar, well known design patterns ONLY if it is a familiar,
well known problem. Since all interesting programs solve new problems it
follows that no interseting program can rely solely on patterns.

Finally, The main value of patterns is in having a shared vocabulary and
frankly there are way too many patterns and dialects for that to work as
well as we would wish. If you want to be universally understood then
stick to the bible ("Design Patterns" by Gamma et al). [This doesn't mean
that you shouldn't read other books - just don't expect everyone else to
know the pattern names]


Jan 28 '06 #13

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: lawrence | last post by:
This has nothing to do with PHP, but I ask it here since I do most of my programming in PHP. What do you think the best book on design patterns is? The book can be written for C or Java or in the...
2
by: Design Pattern Catalog | last post by:
Thank you for your interest in "Design Patterns: Elements of Reusable Object-Oriented Design", by Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides. This message answers several...
1
by: Takayasu Kenduma | last post by:
hi everybody. i am quite new about design patterns and i would like improve my experience in c# applications design. so i choose a common problem as a draft to talk about in the group to find the...
13
by: John Salerno | last post by:
Here are a few I'm considering: Design Patterns Explained : A New Perspective on Object-Oriented Design (2nd Edition) (Software Patterns Series) by Alan Shalloway Design Patterns C# by...
3
by: yb | last post by:
Hi, I just started reading design patterns and looking at the Lexi example. I'm very new to this so please bear with me. I understand the Decorator pattern, but a bit confused by the Maze...
8
by: kk_oop | last post by:
Hi. In our domain, we have to vary a lot of code based on a radar type (of which there are 3--for now). The legacy code acheives this by heavy use of #ifdef macros sprinkled throughout the code. ...
24
by: John Salerno | last post by:
Since Python does so many things different, especially compared to compiled and statically typed languages, do most of the basic design patterns still apply when writing Python code? If I were to...
7
by: =?Utf-8?B?bWF2cmlja18xMDE=?= | last post by:
Hi, I would like to know more about design patterns and specifically using C#. Can any one recommend a good book? Thanks
2
by: LarryTheSoftwareGuy | last post by:
Folks, Would love some suggestions re what design patterns to use for this situation. I need to create a simple FSM. A certain login scenario will behave differently based on the following:...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.