I think what would be interesting to see is how Dave is using his CFC based
views and see if there is a language enhancement that can meet those needs
when not using a framework.
Something that ColdBox (and I’m sure almost any other MVC framework) offers
is the ability to do:
rendered = renderView( view=“/path/to/view”,
args=StructOfDataToMakeAvailable );
This, combined with good use of in the view to DECLARE what
arguments it expects, is a really clean way to have self contained
declarative views.
<!— <<< throws
a really helpful error if the variable is not made available to the view
—>
However, there is a bit of a hack going on here. The view must be included
into the renderer CFC using and thus shares the renderer CFCs
scope (and there’s a bunch of baggage and complexity there that would be
good to avoid).
What would be interesting to play with, is a core language feature to
render a view completely in its own context so that it is entirely self
contained (similar to cfmodule but without the starttag/endtag stuff). The
view then becomes like a standalone CFC with its own API for rendering
(params that it declares that it needs).
rendered = renderTemplate( template=“/path/to/template.lucee”,
arguments=dataIWantAvailableToTemplate );
This can of course be achieved with frameworks, and perhaps that’s where it
belongs - but maybe worthwhile exploring.On 13 February 2015 at 08:53, Michael Offner <@Michael_Offner> wrote:
see my comments between the lines
Micha
On Fri, Feb 13, 2015 at 2:39 AM, Kai Koenig <@Kai_Koenig> wrote:
- the main difference between you (plural) and I is that you try to
push me to do things your way, while I prefer to keep my options openI would strongly debate that, but that’s a different discussion.
- Kai – the fact that you don’t understand something doesn’t make it
bullsh*t. I’ve always treated you with respect – it’d be nice if you’d
try to do the sameJust to make things clear - the bullish*t comment was not targeting you
in particular but anyone in this discussion trying to convince me of
breaking away from common-sense separation of concerns architectural
principles without providing a use case why their proposed solution is
better.Se my argument about it, i’m not only gives you a theoretical anwser, no
my example include a working solution that has a big benefit by not
separation the view layer from the bussiness logic, in one word
“simplification”!Now you HAVE supplied such a case (see below) and we can discuss your
argument. That has nothing to do with not understanding something at all.
- I will try to show an example of what I mean, hopefully the
oversimplification will not make it miss the pointa) I don’t see how the approach below differs from what Abram’s said:
"So, what would stop you from just including a cfm file with your UI
stuff if you want it inside a cfc? To me that is the cleaner approach.”simplification, i dont want to map view templates seperatly in any case, i
dont want this sepration.To me, that’d be a much clearer approach, too, instead of sticking markup
into a component. If you really wanted to have a UIRenderer component.cleaner but more complicated
b) Let’s assume you did NOT have tags in components, how would this
requirement be solved nicely?echo(“
”);Option 1)
Script component including a tag/markup file. That’s essentially the
CFML-based version of a mixin (well, -ish) and I don’t think there’s
anything wrong with that.maybe we could talk about how this files are included, maybe we could
bundle them with a componentOption 2)
Don’t have a UIRenderer component but have tag-based custom tags for
rendering your widget (lists) or pagination etc. THAT is what tag-based
custom tags are really good at and useful for. Then on your page it’d
actually uses the custom tags which probably fits nicely into whatever
layout templating or page wrapper setup you prefer.We have a saying, “all roads lead to rome”, what means your idea is a good
one, but it is for sure not the only one, limitation is most a good things
but in my personal view not in this case!Personally, I think option 2 is much to be preferred as it separates
rendering (tag based in custom tags or templates) from business logic
(script based in components) very nicely.Cheers
Kai–
You received this message because you are subscribed to the Google Groups
“Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/lucee/BC3F190A-2FCF-4F47-A179-C148A86BE835%40gmail.com
.
For more options, visit https://groups.google.com/d/optout.–
You received this message because you are subscribed to the Google Groups
“Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/lucee/CAG%2BEEBwDBgDBPRcSMCvcqKyy1Xqw4vyDutO112qPo-p1N%2BgaNw%40mail.gmail.com
https://groups.google.com/d/msgid/lucee/CAG%2BEEBwDBgDBPRcSMCvcqKyy1Xqw4vyDutO112qPo-p1N%2BgaNw%40mail.gmail.com?utm_medium=email&utm_source=footer
.For more options, visit https://groups.google.com/d/optout.
–
Pixl8 Interactive, 3 Tun Yard, Peardon Street, London
SW8 3HT, United Kingdom
T: +44 [0] 845 260 0726• W: www.pixl8.co.uk• E: info@pixl8.co.uk
Follow us on: Facebook http://www.facebook.com/pixl8 Twitter
http://www.twitter.com/pixl8 LinkedIn
http://www.linkedin.com/pixl8CONFIDENTIAL
AND PRIVILEGED - This e-mail and any attachment is intended solely for the
addressee, is strictly confidential and may also be subject to legal,
professional or other privilege or may be protected by work product
immunity or other legal rules. If you are not the addressee please do not
read, print, re-transmit, store or act in reliance on it or any
attachments. Instead, please email it back to the sender and then
immediately permanently delete it. Pixl8 Interactive Ltd Registered in
England. Registered number: 04336501. Registered office: 8 Spur Road,
Cosham, Portsmouth, Hampshire, PO6 3EB