[prev in list] [next in list] [prev in thread] [next in thread] 

List:       rails
Subject:    [Rails] Other template systems,
From:       steve.willer () gmail ! com (Steve Willer)
Date:       2005-01-29 3:24:36
Message-ID: da1dbeb0501281924191cef22 () mail ! gmail ! com
[Download RAW message or body]

Hi Xiao:

I didn't know that asp.net 2.0 could do multiple forms. I'm glad
they're on their way to making it more usable. Still, MS traditionally
takes 3 versions to get something right, so maybe I'll keep on my path
away from their frameworks.

Since you talked about other template structures, I'd like to mention
an idea I've been playing with. I'm building a kind of clone of Rails
for .NET (yeah, it's embarrassing, but business realities at work
dictate this). I initially built my own aspx parser for the view side,
but now I've replaced it with a new language that uses attributes.
Like this:

  Hi, <span ss:var="ThisUser.Name">some name</span>; how are you doing?

...where the contents of the span tag would be replaced with the value
of whatever was in the attr value, converted to string (the "some
name"-type thrown out content lets you prototype the layout statically
and then keep your dummy data). Or foreach:

  <li ss:foreach="User u in Users"> A user <b ss:var="u.Name">username</b></li>

This setup seems like a cleanup of traditional tag-based languages
without resorting to the somewhat inflexible databinding model. Just
add if, elseif and else, and xpath-style {} stuff inside attrs, and
that's basically it.

For forms, maybe there could be a helper or hook feature, like:

  <input type="text" name="firstname" ss:hook="autofill, validate_required">

...where the hook functions could take a tag as input and transform
them however they want. Maybe a prehook as well, so that hooks can
read the data and save stuff in global state in a first pass through
the tags.

The part that I'm a bit confused about is why this isn't in widespread
use. I can't think of any real flaws in this setup, at least in an
environment that has a clean controller model and one-way dataflow
from C to V. Maybe it could be used in Rails as a new type of view
(yes, a new "easy to use" language). It took me only a few hours to
build a working version that compiles to classes in .NET, including
the time to switch between 3 parsing libraries; I'm sure it would take
15 minutes in Ruby. :-)


On Fri, 28 Jan 2005 17:31:20 -0600, ChongQing Xiao
<CqXiao@epicsystems.com> wrote:
> Hi, Steve:
> 
> Thanks for your reply on asp.net issue. I think you have excellent
> points regarding ASP.NET. To some extent, many of the technology coming
> from Microsoft makes simple things easy but makes complex things near
> impossible.
> In that sense, I think ruby on rails makes simple things easy but still
> possible to do complex stuff.
> 
> Having said that, I believe several issues you have mentioned in your
> post have being addressed in ASP.NET 2.0 - such as multi form support,
> postback without reloading the whole form and a new GRID.
> 
> The main reason I bring up ASP.NET (or Flex) is not to suggest copying
> ASP.NET or Flex into ruby on rails, I am hoping we can borrow some ideas
> from other framework to make ruby on rails better.
> 
> For example, dataBinding in ASP.NET makes binding data to html control
> very easy.
> 
> For example, instead of
> <select name="document">
> <%for @country in @Countries %>
> <option value="<%= @county> ">
> </select>
> 
> We can use
> <selection name="patient[country]" dataSource="@Countries"/>
> </selection>
> 
> Also, template in ASP.NET is also very useful to show table style or
> repeatable html content.
> 
> Thanks
> Chong
> 
> -----Original Message-----
> From: rails-bounces@lists.rubyonrails.org
> 
> [mailto:rails-bounces@lists.rubyonrails.org] On Behalf Of Steve Willer
> Sent: Friday, January 28, 2005 3:51 PM
> To: rails@lists.rubyonrails.org
> Subject: Re: [Rails] Write-up on RoR + XUL Sample
> 
> Xiao (that's your first name, right): I do want to point out that I've
> worked with a lot of different web development models, and I've been
> fighting asp.net for the last 6 months. I'm quite unhappy with it,
> mainly because all of that newfangled stuff just isn't working.
> 
> The control idea is good in theory, but none of the built-in controls
> are flexible and featureful enough. There are also hardly any
> purchasable controls that are really worth even a dollar ... the only
> exception are the telerik controls. Also, the whole control structure
> brought with it a very tight coupling between codebehind and aspx
> (i.e. controller and view) with actual commands rather than just data
> going from C to V. I don't much like having the V contain blocks of
> code either, but helpers and controllers make it easy for you to
> refrain from writing it.
> 
> The viewstate and postback mechanisms needed to support the funky
> controls also have a lot of drawbacks. You can only have one form, so
> you have to go through all sorts of contortions to have simple things
> like a separate search textbox in the top-right of your layout.
> Postback doesn't operate at all in a subrequest, so if you want to
> make your own layout mechanism, you can't have dynamic layouts.
> Viewstate is just a big mess, easily bloating pages to 100K without
> you the developer even realizing it.
> 
> The grid is particularly bad because it saves everything in viewstate,
> it doesn't page data if the dataset is large, and it has plug-ins for
> basic features like sorting and editing, but has no implementation of
> those features or does it halfway. Even Microsoft seems to be dropping
> it for asp.net 2.0, building new controls with new names instead.
> 
> It has felt to me like it's trying to protect me from having to know
> web programming by getting between me and the HTML. But meanwhile,
> it's all mediocre ... if you ever want to get beyond asp.net control
> blah into truly good-looking designs or fast sites (or both), you have
> to just drop the whole thing.
> 
> That's my experience. Rails is exciting to me because it does the
> things I don't want to do when I'm rapidly developing things, but also
> doesn't get in my way when I want to change half of it when the rapid
> development is done.
> 
> On Tue, 25 Jan 2005 17:44:21 -0600, ChongQing Xiao
> <CqXiao@epicsystems.com> wrote:
> > I haven't done java for a while so I won't comment on how JSP will be
> > compared to rhtml but my guess is they are close since both are mixing
> > code with html tag.
> >
> > Compare rhtml with ASP.NET and Flex,
> > Since rhtml is mixing ruby code with html tag,
> > 1. It will be difficult to read if the page becomes complex. I have
> done
> > some work with ASP and it is really a pain to maintain a bunch of .asp
> > files which have mixed vb code and html tags.
> >
> > 2. If a designer (not a programmer) tries to use a standard html
> editor
> > to load the rhtml page, the page might look very different than what
> it
> > should look like because of the embed code. This will make the
> designer
> > have a difficult time to figure out how to improve the looks.
> >
> > 3. No standard way to design reusable components. This is one thing I
> > really like ASP.NET since you can easily plug in a menu, a tree, a
> > tabstrip, a grid
> > which is really a time saver for web development.
> > I know I can reproduce the same function using rhtml + java script but
> > without a standard way (or consistent way) to do it, everyone will
> > reinvent the wheel.
> >
> > Having said above, I will say Ruby on rails is a wonderful framework.
> I
> > especially like ActiveRecord, it really makes database related code
> much
> > much simpler compared with ADO.NET. It is the view part which I hope
> it
> > can be improved. Hopefully I will propose something in the future to
> > make it better.
> >
> > Cheers
> > Chong
> >
> >
> > -----Original Message-----
> > From: rails-bounces@lists.rubyonrails.org
> > [mailto:rails-bounces@lists.rubyonrails.org] On Behalf Of Michael
> > Koziarski
> > Sent: Tuesday, January 25, 2005 4:32 PM
> > To: rails@lists.rubyonrails.org
> > Subject: Re: [Rails] Write-up on RoR + XUL Sample
> >
> > On Tue, 25 Jan 2005 13:16:22 -0600, ChongQing Xiao
> > <CqXiao@epicsystems.com> wrote:
> > > I haven't used flash before but I have read quite a bit about Flex
> > > recently.
> > > (If you are interested, you can take a look at
> > > http://www.macromedia.com/devnet/flex/example_apps.html?id=604)
> > > Too bad Flex is java based, it will be super cool if there is
> similar
> > > solution for ruby on rails.
> > >
> > > Compared with ASP.NET, flex or java face, one area I think ruby on
> > rails
> > > can improve is the view part.
> > > The way how rhtml works is straight forward but I think the
> following
> > > style is cleaner and better than using helper method.
> >
> > That's interesting,  coming from a java background I find it
> > refreshing that RoR *doesn't* create 'yet another programming
> > language' just for view functionality.   What in particular do you
> > find cleaner about the 'psuedo-language' approach?
> >
> > One drawback of the 'full code' approach is that people can abuse it
> > and cram all sorts of things in there.  I've seen JSPs with class
> > definitions in the scriptlets.  However I think that this sort of
> > thing is best handled through code reviews etc.
> >
> > > <rails:DataGrid id="empGrid" dataSource="model:Employees">
> > > ...
> > > </mx:DataGrid>
> > >
> > > chong
> > >
> > > -----Original Message-----
> > > From: rails-bounces@lists.rubyonrails.org
> > > [mailto:rails-bounces@lists.rubyonrails.org] On Behalf Of Todd
> > Grimason
> > > Sent: Tuesday, January 25, 2005 11:32 AM
> > > To: rails@lists.rubyonrails.org
> > > Subject: Re: [Rails] Write-up on RoR + XUL Sample
> > >
> > > * ChongQing Xiao <CqXiao@epicsystems.com> [2005-01-25 12:00]:
> > > > What I am trying to do is I will only use XUL in case it is hard
> to
> > do
> > > > it in html (such as List, Grid, Tab). For web browser which didn't
> > > > support XUL, I will still use HTML instead XUL.
> > >
> > > Depending on your audience and usage, an option with much higher
> > > penetration (over 90%) would be a small Flash compenent embedded for
> a
> > > functional listbox.
> > >
> > > I know many people hate Flash on principle, so please don't freak
> out
> > > and flame me, it's just a suggestion. And less limiting
> > > (audience-wise) than a Mozilla-only solution.
> > >
> > > --
> > >
> > > ______________________________
> > > toddgrimason*todd-AT-slack.net
> > >
> > > _______________________________________________
> > > Rails mailing list
> > > Rails@lists.rubyonrails.org
> > > http://lists.rubyonrails.org/mailman/listinfo/rails
> > > _______________________________________________
> > > Rails mailing list
> > > Rails@lists.rubyonrails.org
> > > http://lists.rubyonrails.org/mailman/listinfo/rails
> > >
> >
> >
> > --
> > Cheers
> >
> > Koz
> > _______________________________________________
> > Rails mailing list
> > Rails@lists.rubyonrails.org
> > http://lists.rubyonrails.org/mailman/listinfo/rails
> > _______________________________________________
> > Rails mailing list
> > Rails@lists.rubyonrails.org
> > http://lists.rubyonrails.org/mailman/listinfo/rails
> >
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic