# LWRP extending property from base class

**URL:** https://discourse.chef.io/t/lwrp-extending-property-from-base-class/11040
**Category:** Chef Infra (archive)
**Created:** [June 20, 2017, 11:34am UTC](https://discourse.chef.io/t/lwrp-extending-property-from-base-class/11040 "2017-06-20T11:34:49Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![patb23in](https://avatars.discourse-cdn.com/v4/letter/p/da6949/32.png) [@patb23in](https://discourse.chef.io/u/patb23in)
#### Post date: [June 20, 2017, 11:34am UTC](https://discourse.chef.io/t/lwrp-extending-property-from-base-class/11040/1 "2017-06-20T11:34:49Z")

</div>

Hi,  
Disclosure:I am new to Chef

I am creating a LWRP by extending 'Websphere Cookbook'.  
All my resources extend [Base Class](https://github.com/Sainsburys/chef-websphere/blob/master/libraries/websphere_base.rb) and the base class has a property called 'bin\_dir'. Is there a way to inherit this property? Currently, in my recipes that call the LWRP, I am setting this property. Please note that this is a common property for all resources & recipes. Anyways to avoid setting it in all my recipes?

I found the following answer to a question [LWRP to extends another cookbook](https://discourse.chef.io/t/lwrp-to-extends-another-cookbook-lwrp/6576)

"There is one exception to this pattern - default. "Default" is special in Chef land, as it doesn't get prefixed. So if you have a cookbook named bacon and an LWRP in bacon/resources/default.rb, the associated LWRP is bacon (not bacon\_default). The associated class is the camel-cased, constantized version of that - Chef::Resource::Bacon and Chef::Provider::Bacon (not "BaconDefault") in this case.  
"

does that apply to property as well, as it is 'defaulted' in the base class?

I also gather from this post that it is not recommended to use lazy init

> [@Can you access node attributes from within a Chef custom resource definition?](https://discourse.chef.io/t/can-you-access-node-attributes-from-within-a-chef-custom-resource-definition/10247/4):
>
> You can do it, it just isn’t recommended. It mostly comes up for using the value of an attribute as the default value for a property, which isn’t the worst thing in the world sometimes. For that just use a lazy definition: property(:foo, default: lazy { node["whatever"] }) Original Quoted context has been removed as per policy

Thanks
