On 15/08/2012, at 9:16 PM, Adam Murdoch wrote:

> 
> On 15/08/2012, at 11:04 PM, Luke Daley wrote:
> 
>> I think we should avoid doing this.
>> 
>> My issue with it is that it's weak modelling. Not to pick on FindBugs (it's 
>> by far not the only plugin that does this, including my own), but what's the 
>> role of a class named “FindBugsExtension”? 
>> 
>> These things have a purpose or function, and the name should reflect it. The 
>> fact that it's a build language extension is not really relevant to its name 
>> I don't think. 
> 
> But that's exactly it's purpose. Every plugin has an extension object that 
> wires in the DSL for that plugin.

That's not how I see it. The extension is *something* that the _plugin_ wires 
into the Gradle mechanics. The extension is a domain object, even if the domain 
is FindBugs. I think extensions should make sense in their own right ideally. 
Maybe that is too idealistic.

> It's just a container for a set of DSL elements for that plugin. That's all 
> it is, the entire reason for its existence. Certainly, each particular 
> element of the plugin's DSL has individual purpose, and should be typed and 
> modelled and named according to it's purpose. No question there.
> 
> The fact that the FindBugs DSL currently only contains properties that define 
> some default values is a coincidence. We might later add, say, some ruleset 
> definitions. These aren't defaults - they're a model. So, FindBugsDefaults 
> would have to be renamed back to FindBugsExtension.

*Defaults is a terrible name. It implies how the object is used, not what it 
is.  I'd be happier with FindbugsSettings.

> These things are DSL extensions.

I'm not quite clear on how that's different to saying a Person object is a 
row/record.

My issue is that this weakens our message that modelling your domain is a way 
to keep complex builds under control. You shouldn't just jam things into the 
build language. You should think about what you are doing and the concepts 
involved. Why is this object in the build language? 

I've seen this a few times now where users have named their extension 
*Extension where it represented a strong concept in their domain. This is what 
I am worried about here.

-- 
Luke Daley
Principal Engineer, Gradleware 
http://gradleware.com

Reply via email to