I've been using engines with great success doing custom shopping carts that rely on a core cart engine for 90% of their functionality. Every client wants something different and it's been a breeze pulling this off with engines since the majority of the code never changes (warehouse, fulfillment, management layer, etc.). What I was wondering is, we often have clients who want two carts, that require very similar engine overrides (they want a public one and bulk marketing one, for example) and it'd be great to DRY in those situations. Are there any suggestions for layering engines so they'd act as a sort of base-engine? Something like this: CompanyCart-A-Rails App < CompanyCartEngine < CoreCartEngine CompanyCart-B-Rails App < CompanyCartEngine < CoreCartEngine Any way of pulling something like off? Can engines use engines in the same way Rails Apps can use engines? -ben
on 2007-01-24 14:31
on 2007-01-24 15:24
On 1/24/07, ben wiseley <email@example.com> wrote: > Are there any suggestions for layering engines so they'd act as a sort of > base-engine? Something like this: There's no reason why you can't do this, if you're careful and design your code sensibly. The key would be to ensure that your 'base' is loaded before any plugins, etc, that might override or customise it. With 1.1.6 of the engines plugin, this would be done by ordering in the Engines.start method: Engines.start :core, :client, :custom With the upcoming 1.2 release, you control load order via the config.plugin array.