Yaws API discussion

Eric Merritt <>
Mon Jul 15 21:02:06 CEST 2002


Alex,

 I am glad that you had success. I would guess (not
having looked at the code I could very well be wrong
here) that you may have used parts of MVC even if you
didn't use a framework or werent thinking about it
conciously. I have seen this happen quite allot with
other types of patterns. Programmers reinvent patterns
(like singletons in OO) all the time without ever
knowing it. Even if you didnt go this route I think
that a decent coder can make either approach work. I
would make the argument that using MVC makes it much
easier and increases your chance of success especially
for mediocre programmers or those without allot of
experience. In my opinion, really good coder could
probably write a dynamic, extensably app in brainf**k
but I would want to do it myself. For that matter I
wouldnt want to be the one to maintain it after he
leaves. 

 As for Microsofts solution IBM tried to do the
samething with a project call Net.Data that failed
pretty miserably. My other argument is that Microsoft
(like many companies) tends to target the lowest
common denominator with its products. In this
instance, I woulds say that the lowest common
denominator here are those mediocre programmers
mentioned above. Doing things right and according to a
set pattern makes things much more difficult in the
begining, but over time it pays off. Many programmers
either just want to get it done quick, or dont think
about the long term, hence the preference for the
embedded solutions like PHP/ASP. This may be the
reason Microsoft decided to go back to the 'old'
solution. 

In any case, I congradulate you on your success and
thank you for your opposing viewpoint.

Thanks,
Eric

 Ps. please excuse my terrible spelling, yahoo still
hasn't gotten the spellcheck feature to work in
mozilla.

--- Alex Peake <> wrote:
> Let me state a counter-point.
> 
> Microsoft, in its release of ASP.NET also took this
> approach of separating the UI from the data.
> However, they have just released a product called
> WebMatrix, which goes back to the "old" way - my
> guess is that too many people are comfortable with
> the "mixed" approach and so Microsoft responded.
> 
> From my own point of view, I have built large
> dynamic web sites with this mixed approach, and have
> had no problems evolving the solution at all.
> 
> Alex
> 
> 
> > -----Original Message-----
> > From: 
> > [mailto:]On
> Behalf Of Eric Merritt
> > Sent: Monday, July 15, 2002 10:14 AM
> > To: ;
> 
> > Subject: Re: Yaws API discussion
> >
> >
> > Mickael,
> >
> >  Per your request I am going to make a few
> > suggestions. I would, however, warn readers that I
> > will be swimming in what some consider a holy war
> > area. I do not intend any kind of little war here,
> I
> > am just providing suggestions based on my
> experience
> > and knowlege.
> >
> > I believe that the problem you are having stems
> from a
> > core problem with the paradigm yaws has adopted.
> Yaws,
> > like PHP and JSP Scriptlets, is founded upon the
> idea
> > that actual logic should be embedded in the html
> page.
> > This is a bad thing(TM). It limits scalability of
> the
> > application by quite a bit. I am not refering to
> > scalability in terms of speed or performance, but
> to
> > scalablity in terms of application size,
> > reliablity/maintenance, and extensablility.
> >
> > I am rambling here so forgive me. Back in the
> early
> > '80s users of smalltalk realized that the ui
> design
> > paradigms of the time were lacking for large
> projects.
> > To address the issue they came up with a paradigm
> > called MVC (Model, View, Controller). This
> basically
> > stated that your model (data, logic) should be
> > seperated from your controller (flow control
> logic)
> > and all of that should be seperated from your view
> > code. It eventually was expoused that the view
> code
> > should be extreamly limited. In that it only
> allows
> > you to manipulate data provided from your model
> layer.
> >
> >
> > This was a really good idea for UIs, and when the
> WEB
> > came about it proved to be a really good idea for
> > webapplications as well.
> >
> >  To use some hisorical examples, the inventors of
> JSP
> > realized this same issue after they released the
> first
> > JSP specification. In that original specification
> JSPs
> > allowed only scriptlets (which is java code
> imbedded
> > in the html and delimited by <% %> tags). This
> > approach was obviously not MVC like in any way. In
> > fact, it cuased quite allot of headaches for
> > developers then (and even in somecases now). Thier
> > next release included the idea of 'TagLibs' which
> are
> > custom tags that use data from provided from some
> > backend process (via session and request
> variables).
> > Now the use of scriptlets are frowned upon almost
> > universally and are actaully not allowed to be
> used in
> > most big projects. This still wasn't really a
> complete
> > MVC solution as the coder had to code allot of the
> > controller and logic framework himself, but it did
> > provide a foundation. Projects like Struts have
> made
> > good use of this foundation and provide full blown
> MVC
> > frameworks now. Using these frameworks has made
> web
> > application programming much much easier.
> >
> >
> > Well to get back to your problem. If your
> > Model/Controller layer only provided data to your
> view
> > and your view simply made use of that data all you
> > would need to do is include the header and it
> could
> > make use of all the data that was globally
> available
> > in the page. In JSPs that is simply an <@include
> 'page
> > location'> directive. The included page then
> simply
> > makes use of the data already provided.
> >
> > I realize that the yaws api is based to quite a
> large
> > extent on PHP, but PHP is a very poor choice for
> > large, extensable applications. Don,t get me wrong
> PHP
> > is a great thing for quick and dirty applications.
> > Basically for those applications that only span a
> few
> > pages or that are only designed to live a short
> time.
> > Anything beyond that and PHP starts to fall down.
> >
> > I would suggest that you take a look at some of
> the
> > Java page rendering technology. They have allot of
> > experience in this type of thing by now. Probably
> > start out with the taglib stuff and then take a
> look
> > at Struts (available at
> jakarta.apache.org/struts).
> > Perhaps also take a look at webmacro
> > (www.webmacro.org) and velocity
> > (jakarta.apache.org/velocity). I personally like
> the
> > idea of taglibs and compiled pages (I think they
> are
> > much faster), but the template engines and thier
> > restricted data manipulation langauges are nice as
> > well.
> >
> > I guess I went kind of long, sorry. I also hope I
> did
> > not get anyone too angry.
> >
> > Thanks,
> > Eric
> >
> > ---  wrote:
> > > Hello,
> > >
> > > I feel that there is a need to improve an aspect
> of
> > > yaws api.
> > >
> > > The ssi function can be used to include some
> > > external html template. My need is to be able to
> add
> > > some dynamic generated values (for example the
> title
> > > in the html header portion)
> > >
> > > I am thinking on the best way to do that. The
> most
> > > evident thing is to pass a dictionnary of
> > > substitution that needs to be  performed in the
> > > included file.
> > >
> > > I think it might not be interesting to implement
> > > nested evaluation of included files.
> > >
> > > What do you think ?
> > > Any clever idea ?
> > >
> > > --
> > > Mickakl Rimond
> > > http://www.erlang-fr.org/
> > >
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Yahoo! Autos - Get free new car price quotes
> > http://autos.yahoo.com
> >
> 
> 
=== message truncated ===


__________________________________________________
Do You Yahoo!?
Yahoo! Autos - Get free new car price quotes
http://autos.yahoo.com



More information about the erlang-questions mailing list