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 !
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 :-))
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 ?
Yeah, this is just C#, optimize by first creating a local variable for cpa.ActionHandlers.
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 !
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
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 :-))
is working on a reply...