[chef-dev] Re: Re: local file copy resource?


Chronological Thread 
  • From: Daniel DeLeo < >
  • To: Jesse Campbell < >
  • Cc: Noah Kantrowitz < >, Chef Dev < >
  • Subject: [chef-dev] Re: Re: local file copy resource?
  • Date: Sat, 8 Dec 2012 16:48:59 -0800

On Saturday, December 8, 2012 at 4:09 PM, Jesse Campbell wrote:
I think I'd like to see consistency with the Template resource, using
a "source" option to specify a string filename.

I'm not exactly an expert at inheritance and composition in Ruby, but
maybe someone on here is?
Both are used in the existing source code. For example, the thing that sets all the mode and owner bits is a FileAccessControl object. Adding functionality by having classes that implement bits of it in this style is _composition_.

Contrast this with how the service providers implement bits of functionality directly in the class, and then more-specific service providers reuse that functionality by inheriting (e.g., the class SpecificServiceProvider < GenericServiceProvider bit). Adding modules with `include` also counts as inheritance.

Here's a recent blog post comparing composition to piping Unix commands together: http://blog.codeclimate.com/blog/2012/11/28/your-objects-the-unix-way/


-- 
Daniel DeLeo





Archive powered by MHonArc 2.6.16.

§