[chef] Re: [Template] - variables vs direct attribute access


Chronological Thread 
  • From: Tensibai Zhaoying < >
  • To:
  • Subject: [chef] Re: [Template] - variables vs direct attribute access
  • Date: Fri, 31 Oct 2014 13:20:23 +0100

Variable could be something calculated or logically choosen. The idea is as with mvc models to keep logic away of the template as possible.

Exemple for a jee server you may calculate the heap value from Os type and available ram, it's better to have it inside the recipe than the template.

This way you may set an arbitrary value for rendering (on test to limit the value) instead of cloning the template.

So IMHO not a fail, a valuable feature to use wisely to avoid complex logic in template when it makes sense



---- aL. a écrit ----

Ohai chefs!

I just having a talk with a team member about why or why not use "variables" with lazy or not on template resources.

I dont know what is the right way or the "bad practice" way of doing this. Because if you can access attributes directly inside the template, and attributes are compiled an resolved on compile time. ¿Why are you going to want to use variables params on templates?

Could be that varibles were just another fail point on the chain, right?

Thanks a lot!!!
--
Si necesitas una máquina para hacer algo y no la compras al final te darás cuenta de que has pagado lo mismo y no tienes la máquina.--Henry Ford
Alberto



Archive powered by MHonArc 2.6.16.

§