Re: [OT] Design Patterns in mod_perl apps?

2001-02-06 Thread Bakki Kudva

Thank you for that pointer. I checked http://www.pagekit.org/. Looks
very interesting.
While on the subject I'd like to mention another really nice book by
Mark Grand  called "Patterns in Java" that might be of interest to those
looking into Design Patterns. This book has many additional pattern to
those in GoF such as 'concurrency patterns' and 'filter' which Gunther
was alluding to. Also there is a chapter on UML which was very useful to
me. The patterns are all illustrated with UML.

It would be terrific if those who ARE using Design Patterns in their web
apps could contribute to a 'Design patterns' chapter to Stas's Guide. I
would have been happy to volunteer but for the 
fact that I am way early on my learning curve and it will be a while
before I can do it.

-or-

Gunther, I have two of your books on my shelf and would love to add a
third one, how about it? :))

-bakki

Perrin Harkins wrote:
> 
> Gunther Birznieks wrote:
> > GoF did not introduce Model-View-Controller architecture. But it is
> > discussed in Wiley's "A System of Patterns: Pattern-Oriented Software
> > Architecture".
> 
> MVC is frequently used in mod_perl apps.  For example, see
> Apache::PageKit.
> - Perrin

-- 
  _ _
 .-. |M|S|  Bakki Kudva
 |D|_|a|y|  Navaco
 |o|m|n|s|<\420 Pasadena Drive
 |c|e|a|t| \\   Erie, PA 16505-1037
 |u|n|g|e|  \\  http://www.navaco.com/
 | |T|e|m|   \> ph: 814-833-2592
""  fax:603-947-5747
e-Docs



Re: [OT] Design Patterns in mod_perl apps?

2001-02-05 Thread Perrin Harkins

Gunther Birznieks wrote:
> GoF did not introduce Model-View-Controller architecture. But it is
> discussed in Wiley's "A System of Patterns: Pattern-Oriented Software
> Architecture".

MVC is frequently used in mod_perl apps.  For example, see
Apache::PageKit.
- Perrin



Re: [OT] Design Patterns in mod_perl apps?

2001-02-05 Thread Bakki Kudva

I would like to close this thread with LOTS of THANK YOUS to Gunther who
gave me tons of very valuable information on the subject. I am still in
the process of digging my way through design patterns, but still at the
'huh?' stage but am optimistic that very soon will have the 'Aha!' as
the intro to the book says :)

 to perl/oop gurus (Damian, if you are listening): Time is ripe
for a modern design patterns in perl book 

best,

bakki

Gunther Birznieks wrote:
 
> The download link may be old. You might want to go to the extropiaperl
> project on SourceForge and get latest code using anonymous CVS.

> Also, in the last 2 months we really revamped the architecture to change
> from a central control loop to action handlers where a stream of action
> objects where the application is defined by the order and process through
> which the action handlers get processed.  This is similar to the Struts
> project for the Java Servlet API on java.apache.org.
> 
> It turns out to be a fairly powerful model that has increased our
> productivity even more.
> 
> >In addition, Webware will give me some real world apps to look at to get
> >a sense of how CoR, flyweight etc are implemented, especially in Perl.
> >This is right on the money as far as what I am trying to learn.
> 
> That was part of our intention. We didn't really spend a LOT of time on
> design patterns, but certainly they had a strong influence.
> 
> > > There have been tons of articles and books on Design Patterns since GoF
> >
> >Any specific web design patterns book you would recommend?
> 
> If i was back home in the USA I could probably give you quite a few. As it
> is, I am afraid that I've just relying on articles here and there in the
> last 2 years because I never took my entire library with me when I moved to
> London and then to Singapore... I've been traveling more lightweight.
> 
> GoF did not introduce Model-View-Controller architecture. But it is
> discussed in Wiley's "A System of Patterns: Pattern-Oriented Software
> Architecture".
> 
> I think Addison-Wesley has a series of books based on the Pattern Languages
> symposia over the last many years which gives an overview.
> 
> Any article by PJ Plauger I've ever read is pretty good. You can look a lot
> of his stuff up by searching the web for his name plus patterns.
> 
> Malveau and Mowbray's CORBA Design Patterns is a really good book for
> anyone doing distributed programming even if it's not CORBA.
> 
> The Pattern Almanac from Addison-Wesley doesn't really describe patterns
> all that well but it does provide a lot of references to existing works and
> provides very very short but easy to read summaries of many patterns out there.
> 
> The cool thing about the Pattern Almanac is that it has a lot of patterns
> that are not idomatic to OO but apply to many situations.
> 
> For example, it even has a section on "Patterns for Designing in Teams"...
> which include  Multiple Competing Designs, Decision Document,
> Creator-Reviewer, Master-Journeyman, and Ad-Hoc Corrections
> 
> Thanks,
> Gunther

-- 
  _ _
 .-. |M|S|  Bakki Kudva
 |D|_|a|y|  Navaco
 |o|m|n|s|<\420 Pasadena Drive
 |c|e|a|t| \\   Erie, PA 16505-1037
 |u|n|g|e|  \\  http://www.navaco.com/
 | |T|e|m|   \> ph: 814-833-2592
""  fax:603-947-5747
e-Docs



Re: [OT] Design Patterns in mod_perl apps?

2001-02-03 Thread Gunther Birznieks

At 11:42 AM 1/31/2001 -0500, Bakki Kudva wrote:

>I just quickly browsed through Chapter 10 (104 pages !!) and it shines
>light on EXACTLY the sort of things I was thinking about. It is like the
>'Design Patterns' & 'Conway book' fused into one. I also downloaded the
>webware apps so I can disect and learn from them. I'll be busy for the
>next few months:)

Thanks. :)

The download link may be old. You might want to go to the extropiaperl 
project on SourceForge and get latest code using anonymous CVS.

Also, in the last 2 months we really revamped the architecture to change 
from a central control loop to action handlers where a stream of action 
objects where the application is defined by the order and process through 
which the action handlers get processed.  This is similar to the Struts 
project for the Java Servlet API on java.apache.org.

It turns out to be a fairly powerful model that has increased our 
productivity even more.

> > eg we use CoR in filters that are specific to handling content in our apps.
> > We use (depending on how you view it) CoR or flyweight for dealing with
> > stuff like data handlers (which are essentially filters for *incoming*
> > content)
>
>In addition, Webware will give me some real world apps to look at to get
>a sense of how CoR, flyweight etc are implemented, especially in Perl.
>This is right on the money as far as what I am trying to learn.

That was part of our intention. We didn't really spend a LOT of time on 
design patterns, but certainly they had a strong influence.

> >
> > Web apps do operate differently to regular apps and the design patterns or
> > idioms you might wish to use may be different. Since as the GoF book puts
> > it, all patterns have their advantages and also their consequences. Those
> > consequences may be OK for a regular app but not for a web app.
> >
> > There have been tons of articles and books on Design Patterns since GoF
>
>Any specific web design patterns book you would recommend?

If i was back home in the USA I could probably give you quite a few. As it 
is, I am afraid that I've just relying on articles here and there in the 
last 2 years because I never took my entire library with me when I moved to 
London and then to Singapore... I've been traveling more lightweight.

GoF did not introduce Model-View-Controller architecture. But it is 
discussed in Wiley's "A System of Patterns: Pattern-Oriented Software 
Architecture".

I think Addison-Wesley has a series of books based on the Pattern Languages 
symposia over the last many years which gives an overview.

Any article by PJ Plauger I've ever read is pretty good. You can look a lot 
of his stuff up by searching the web for his name plus patterns.

Malveau and Mowbray's CORBA Design Patterns is a really good book for 
anyone doing distributed programming even if it's not CORBA.

The Pattern Almanac from Addison-Wesley doesn't really describe patterns 
all that well but it does provide a lot of references to existing works and 
provides very very short but easy to read summaries of many patterns out there.

The cool thing about the Pattern Almanac is that it has a lot of patterns 
that are not idomatic to OO but apply to many situations.

For example, it even has a section on "Patterns for Designing in Teams"... 
which include  Multiple Competing Designs, Decision Document, 
Creator-Reviewer, Master-Journeyman, and Ad-Hoc Corrections

Thanks,
Gunther




Re: [OT] Design Patterns in mod_perl apps?

2001-01-31 Thread Bakki Kudva

Wow!! Gunther you've done it again. I ask for some nuggets and you've
given me the gold mine :)

Gunther Birznieks wrote:
> 
> If you look at the latter half of the on-line book at
> http://www.extropia.com/ExtropiaObjects/ and read the module chapters after
> and including the "Architecture" chapter you will see a sidebar in each
> chapter devoted to identifying design patterns that were used in that set
> of related modules.

I just quickly browsed through Chapter 10 (104 pages !!) and it shines
light on EXACTLY the sort of things I was thinking about. It is like the
'Design Patterns' & 'Conway book' fused into one. I also downloaded the
webware apps so I can disect and learn from them. I'll be busy for the
next few months:)

> eg we use CoR in filters that are specific to handling content in our apps.
> We use (depending on how you view it) CoR or flyweight for dealing with
> stuff like data handlers (which are essentially filters for *incoming*
> content)

In addition, Webware will give me some real world apps to look at to get
a sense of how CoR, flyweight etc are implemented, especially in Perl.
This is right on the money as far as what I am trying to learn.

> >3. Are there any new patterns useful for mod_perl apps?
> 
> Lots. But I think you mean Web apps not mod_perl apps. Web Apps abound with
> idioms and design patterns. There are many which have been identified since
> the GoF book such as Session which I think nearly all large web apps use. :)

You were correct in paraphrasing my question to mean web apps. At the
moment I happened to be thinking in terms of mod_perl handlers.
 
> >4. Am I wasting my time with OO and design patterns if the goal was
> >writing a mod_perl app?
> 
> I guess it depends on what you mean by a mod_perl app. If you mean a web
> app that runs on top of mod_perl, then you should use good OO because I
> suspect you'll want to expand that app and do things later with it which
> means the cost of maintenance is an issue not just the speed.
> 
> If, however, you are writing some custom auth handler or something like
> that, then the efficacy of sticking to OO is less because (A) Yes, you
> could lose some performance in some cases, and (B) Because the auth handler
> is likely to be so tiny that OO would not make sense. OO is better for
> larger programs so that they can be broken down more easily.

I can see the distinction now. seems obvious now that I hear you say it
:)

> PS Caveat: Don't go overboard on design patterns. GoF book was written with
> typical apps in mind. Web apps were not in their view scope at the time.
> 
> Web apps do operate differently to regular apps and the design patterns or
> idioms you might wish to use may be different. Since as the GoF book puts
> it, all patterns have their advantages and also their consequences. Those
> consequences may be OK for a regular app but not for a web app.
> 
> There have been tons of articles and books on Design Patterns since GoF

Any specific web design patterns book you would recommend?

> book was out. It's good to absorb GoF, but don't use it to hammer
> everything because you've read something new and cool. Asking your
> questions certainly shows you seem to understand that anyway, so I am
> probably preaching to the choir. :)

Again, thank you for some terrific and valuable insights. I feel I got a
lot more than I bargained for and that's why I love this LIST !

bakki
-- 
  _ _
 .-. |M|S|  Bakki Kudva
 |D|_|a|y|  Navaco
 |o|m|n|s|<\420 Pasadena Drive
 |c|e|a|t| \\   Erie, PA 16505-1037
 |u|n|g|e|  \\  http://www.navaco.com/
 | |T|e|m|   \> ph: 814-833-2592
""  fax:603-947-5747
e-Docs



RE: [OT] Design Patterns in mod_perl apps?

2001-01-31 Thread Geoffrey Young



> -Original Message-
> From: Gunther Birznieks [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, January 30, 2001 6:43 PM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Re: [OT] Design Patterns in mod_perl apps?
> 
> 
> 
> If you look at the latter half of the on-line book at 
> http://www.extropia.com/ExtropiaObjects/ and read the module 
> chapters after 
> and including the "Architecture" chapter you will see a 
> sidebar in each 
> chapter devoted to identifying design patterns that were used 
> in that set 
> of related modules.

I read through chaper 10 - that is an extremely well written (extensive)
summary of what we are all trying to do here...

well done

--Geoff
 



Re: [OT] Design Patterns in mod_perl apps?

2001-01-30 Thread Gunther Birznieks

At 02:13 PM 1/30/01 -0500, Bakki Kudva wrote:
>I am studying mod_perl and the GoF Desing Patterns book in parallel and
>had a few questions I would like to throw to the list.
>
>1. Is there anyone who is using GoF design patterns (eg. Chain of
>Responsibility for handlers) in their mod_perl apps?

Yes. The most common is filtering content. There are a lot of mod_perl 
specific filters.

If you look at the latter half of the on-line book at 
http://www.extropia.com/ExtropiaObjects/ and read the module chapters after 
and including the "Architecture" chapter you will see a sidebar in each 
chapter devoted to identifying design patterns that were used in that set 
of related modules.

eg we use CoR in filters that are specific to handling content in our apps. 
We use (depending on how you view it) CoR or flyweight for dealing with 
stuff like data handlers (which are essentially filters for *incoming* 
content)

>2. Is the overhead of OO Perl acceptable for mod_perl apps, generally
>speaking?

Yes. Very few people really need to eek out all the speed in world. Most 
people just want fast apps, they don't need the fastest apps. That's one 
reason why PHP and Microsoft ASP is so popular... they're fast or rather 
fast enough without being hard.

Mod_perl could be a lot faster than PHP but it's more of a learning curve 
for people who don't know Perl well.

>3. Are there any new patterns useful for mod_perl apps?

Lots. But I think you mean Web apps not mod_perl apps. Web Apps abound with 
idioms and design patterns. There are many which have been identified since 
the GoF book such as Session which I think nearly all large web apps use. :)

>4. Am I wasting my time with OO and design patterns if the goal was
>writing a mod_perl app?

I guess it depends on what you mean by a mod_perl app. If you mean a web 
app that runs on top of mod_perl, then you should use good OO because I 
suspect you'll want to expand that app and do things later with it which 
means the cost of maintenance is an issue not just the speed.

If, however, you are writing some custom auth handler or something like 
that, then the efficacy of sticking to OO is less because (A) Yes, you 
could lose some performance in some cases, and (B) Because the auth handler 
is likely to be so tiny that OO would not make sense. OO is better for 
larger programs so that they can be broken down more easily.

My personal experience is that web programs tend to fit the bill for OO if 
they go beyond simple 1-off logic such as form processing. I think OO is 
overkill if all you would have is just one object because the program is so 
simple.

Later,
Gunther

PS Caveat: Don't go overboard on design patterns. GoF book was written with 
typical apps in mind. Web apps were not in their view scope at the time.

Web apps do operate differently to regular apps and the design patterns or 
idioms you might wish to use may be different. Since as the GoF book puts 
it, all patterns have their advantages and also their consequences. Those 
consequences may be OK for a regular app but not for a web app.

There have been tons of articles and books on Design Patterns since GoF 
book was out. It's good to absorb GoF, but don't use it to hammer 
everything because you've read something new and cool. Asking your 
questions certainly shows you seem to understand that anyway, so I am 
probably preaching to the choir. :)







Re: [OT] Design Patterns in mod_perl apps?

2001-01-30 Thread Bakki Kudva

"Ken Y. Clark" wrote:
> 
> > 1. Is there anyone who is using GoF design patterns (eg. Chain of
> > Responsibility for handlers) in their mod_perl apps?
> 
> Well, I don't want to sound stupid, but I don't know what you're
> talking about.  That's one of the hazards of having a degree in English
> and not CS, I guess?  :)

Oops! Sorry. The book is 'Design Patterns' by Erich Gamma, et al and the
four authors are known as the Gang of Four in OO circles I believe.
Design Patterns "capture solutions that have developed and evolved over
time". The main theme is to promote CODE REUSE via decoupling of
classes. The book talks about 'message flow' in your app vs. 'data flow'
which makes classes dependent on each other and reduce their REUSE
potential. I am finding it fascinating.

bakki
-- 
  _ _
 .-. |M|S|  Bakki Kudva
 |D|_|a|y|  Navaco
 |o|m|n|s|<\420 Pasadena Drive
 |c|e|a|t| \\   Erie, PA 16505-1037
 |u|n|g|e|  \\  http://www.navaco.com/
 | |T|e|m|   \> ph: 814-833-2592
""  fax:603-947-5747
e-Docs



Re: [OT] Design Patterns in mod_perl apps?

2001-01-30 Thread Ken Y. Clark

On Tue, 30 Jan 2001, Bakki Kudva wrote:

> Date: Tue, 30 Jan 2001 14:13:14 -0500
> From: Bakki Kudva <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: [OT] Design Patterns in mod_perl apps?
> 
> I am studying mod_perl and the GoF Desing Patterns book in parallel and
> had a few questions I would like to throw to the list.
> 
> 1. Is there anyone who is using GoF design patterns (eg. Chain of
> Responsibility for handlers) in their mod_perl apps?

Well, I don't want to sound stupid, but I don't know what you're
talking about.  That's one of the hazards of having a degree in English
and not CS, I guess?  :)

> 2. Is the overhead of OO Perl acceptable for mod_perl apps, generally
> speaking? 

Sure.  

> 3. Are there any new patterns useful for mod_perl apps?

I'm not sure what was old or what constitutes new.  I tend to write a
lot of vanilla handlers.  I've looked into Mason and AxKit and such,
and they're fantastic, but just shifting $r and returning OK seems to
work really well most of the time.

> 4. Am I wasting my time with OO and design patterns if the goal was
> writing a mod_perl app?

Absolutely not.  If an OO design is appropriate, then use it.  When
I've wanted an object, I've created it.  I've even used OO methodology
to write base classes for handlers and deriving from them for other
handlers.  Just do what feels right and enjoy yourself.

ky