# Purpose of Definitions?

**URL:** <https://discourse.chef.io/t/purpose-of-definitions/2660>\
**Category:** Chef Infra (archive)\
**Created:** [April 3, 2012, 3:30am UTC](https://discourse.chef.io/t/purpose-of-definitions/2660 "2012-04-03T03:30:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![realityforge](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/realityforge/32/395_2.png) [@realityforge](https://discourse.chef.io/u/realityforge)\
**Post date:** [April 3, 2012, 3:30am UTC](https://discourse.chef.io/t/purpose-of-definitions/2660/1 "2012-04-03T03:30:25Z")

</div>

Hi,

I am curious why you would ever use definitions when LWRPs exist?  
AFAICT they are just a pseudo-resource with a somewhat more complex  
syntax. Are they legacy from before LWRPs or am I missing something?

–  
Cheers,

Peter Donald

---

<div class="post-metadata">

**Author:** ![AJ\_Christensen](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/aj_christensen/32/525_2.png) [@AJ\_Christensen](https://discourse.chef.io/u/AJ_Christensen)\
**Post date:** [April 3, 2012, 3:32am UTC](https://discourse.chef.io/t/purpose-of-definitions/2660/2 "2012-04-03T03:32:07Z")

</div>

On 3 April 2012 15:30, Peter Donald [peter@realityforge.org](mailto:peter@realityforge.org) wrote:

> Hi,
> 
> I am curious why you would ever use definitions when LWRPs exist?  
> AFAICT they are just a pseudo-resource with a somewhat more complex  
> syntax. Are they legacy from before LWRPs or am I missing something?

They sure are legacy! You can think of them more like a macro, when  
you use it in a recipe, the body is replaced with the contents of the  
definition, with the parameters all obviously available.

I have seen some varied usage of mix-matching definitions and lwrps,  
especially when you need to group multiple lwrps togethers. Some might  
argue for a purist approach.

--AJ

> --  
> Cheers,
> 
> Peter Donald
