Yaakov Nemoy wrote:
> 2009/3/18 Michael DeHaan <mdehaan(a)redhat.com>:
>
>> Max Spevack wrote:
>>
>>> On Sat, 14 Mar 2009, Yaakov Nemoy wrote:
>>>
>>>
>>>
>>>> It can really depend on the workflow and what kind of data is being
>>>> inserted. It all boils down to putting lots of strings together, so
>>>> you want to organize it around whether you're concatting data alot
or
>>>> inserting into predefined templates. When it comes down to it, it's
>>>> really such a low level thing that it shouldn't affect the overall
>>>> design.
>>>>
>>>> Bottom line is, you pick the design that you prefer. I have a very
>>>> slight preference for Object - Proxy patterns, but i'm just asking
if
>>>> anyone else has an opinion at all. Otherwise, i'll probably look at
>>>> code generation, out of personal preference.
>>>>
>>>>
>>> Personally, I have no strong preference, and would trust you to make a
>>> good choice.
>>>
>>> --Max
>>> _______________________________________________
>>> ekg mailing list
>>> ekg(a)lists.fedorahosted.org
>>>
https://fedorahosted.org/mailman/listinfo/ekg
>>>
>>>
>> If you're looking for outside contributors, they generally hate XSLT...
>> and the OO craziness to generate HTML
>> is also obtuse. The best thing to do is keep it simple if you want it
>> hackable.
>>
>> Why not just templates people typically use for web development, such as
>> Cheetah or Genshi?
>>
>
> I'm not planning on using XSLT, i meant it only as an example.
>
> The best kinds of HTML generation libraries are the kind that
> integrate into the language's natural features. For example, in the
> .Net languages, you can actually embedd SQL code and HTML output in
> your code, and the interpreter/compiler will convert that block of
> code into a concrete object that can be further manipulated. Even so,
> it's a design pattern that for one reason or another never quite
> gained the popularity MVC did.
>
> I debated using templates, but then i decided the goal is to spell out
> a list of reports rather than designing a web app. All the code should
> be reusable though later if we ever decide to integrate this somewhere
> else.
>
> I definitely appreciate your opinion, and you're right, i am going to
> keep it as simple as i can.
>
> -Yaakov
Just to be clear, templates can be done without a web app.
I do that with Cheetah all the time for lots of things that aren't web
app related as well as the web app.
The stuff that makes h1() and such look like functions can seem cool at
first, but when you get a really sharp web person who wants to spice
something up, they usually don't want to edit that but are comfortable
with templates.
Do we want to bring TG or Django in here? Probably not, but a template
engine could be helpful.
Point taken, and i'm aware of that we can do that. We can probably switch later,
i'm not getting to invested in anything at the moment. Part of doing the html
generation via 'h1()' (actually it's 'with h1(attr='foo'):')
is that from a template standpoint, handling widgets is exactly the same way. If a graphic
designer gets on board with this, i'm sure there will be no smalll amount of
templating involved as well.
-Yaakov