Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Laurent Lequenne 120 posts 245 karma points
    May 16, 2011 @ 13:45
    Laurent Lequenne
    0

    DynamicNode and property caching

    I guess it is not ? So if I have some function like

    dynamic cpa;  => DynamicNode

    if (cpa.ActionHandlers != null && cpa.ActionHandlers.Length > 0) { DoSomething(cpa.ActionHandlers);}

    The property ActionHandlers will be parsed 3 times through the XML Node ? And it's thus best to get a local value to work with it ?

     

  • Sebastiaan Janssen 4899 posts 14655 karma points MVP admin hq
    May 16, 2011 @ 14:06
    Sebastiaan Janssen
    0

    Yeah, this is just C#, optimize by first creating a local variable for cpa.ActionHandlers.

  • Laurent Lequenne 120 posts 245 karma points
    May 16, 2011 @ 14:17
    Laurent Lequenne
    0

    Yah ! but sometime we are lazy for a small overhead... But if it's not that small, then I guess we definitely go that way ... It will be some more work to go from Umbraco.Linq to DynamicNodes... But seems already to be huge :-)

    Remark : It's kind of shame that thing  is not returning always the correct Type for a property, if I enter a integer value in a string field, it returns an integer... But as it can be CSV of integers !

  • Sebastiaan Janssen 4899 posts 14655 karma points MVP admin hq
    May 16, 2011 @ 14:26
    Sebastiaan Janssen
    0

    There's a tradeoff for the dynamic goodness, for sure :-)

    If you like linq, make sure to check out UQL, which brings back a lot of linq stuff to Umbraco Razor.

    If you want the string back, do something like: @Model.GetProperty("ActionHandlers").Value

  • Laurent Lequenne 120 posts 245 karma points
    May 16, 2011 @ 14:46
    Laurent Lequenne
    0

    Umbraco.Linq : I used for my 2 previous project and it's totally not satisfying me ! It's slow, I suspect it gets huge memory load, and  it's not easy to navigate the way I want, and I have often to mix the umbraco.NodeFactory selections with Linq ! And most bad of all, it's not updating his cache when we publish items as long we are using a static instance of the DataContextProvider  => that is the only solution, too not spend huge load time at every request....

    So currently I start to use the DynamicNodes within classic ASP.NET, and the few code I already managed seems really more cool to maintain, with less code,  regardless the lack of intellisense it's a true benefit. For the performance I guess that with a better language we can defeats XSLT :-))

     

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies