Quantcast

adding method to ModifiableItemGroup

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

adding method to ModifiableItemGroup

nicolas de loof-2
Hi folks,

for JENKINS-14902 I would like Jenkins.createProjectFromXML to be part of ModifiableItemGroup interface
side effect is that adding such a method to an interface would break backward compatibility for plugins that implement this interface (even I don't know such a plugin but cloudbees folders)

option 1 :
use "duck typing" style and call createProjectFromXML by reflexion on ItemGroup if such a method exists

option 2 :
create a new interface to extend ModifiableItemGroup and add createProjectFromXML

option 3 : add method to ModifiableItemGroup

wdyt ? 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: adding method to ModifiableItemGroup

Jesse Glick-4
On 08/23/2012 05:28 AM, nicolas de loof wrote:
> option 2 :
> create a new interface to extend ModifiableItemGroup and add createProjectFromXML

Seems safest. ModifiableItemGroup2 perhaps. It probably need not even extend ModifiableItemGroup, since if someone is actually assigning something to a variable of type
ModifiableItemGroup2 they are not likely to want the old HTTP-based method too.

While you are at it, consider making the interface specify some related things, e.g.:

<T extends TopLevelItem> T copy(T src, String name) throws IOException;
TopLevelItem createProject(TopLevelItemDescriptor type, String name, boolean notify) throws IOException;

though these are less likely to be useful from the CLI.

BTW a ModifiableViewGroup might also be useful at some point.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

RE: adding method to ModifiableItemGroup

Sandell, Robert-2
In reply to this post by nicolas de loof-2

Option 2

 

I’m a safety first kind of guy J

 

/B

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of nicolas de loof
Sent: den 23 augusti 2012 11:29
To: [hidden email]
Subject: adding method to ModifiableItemGroup

 

Hi folks,

 

for JENKINS-14902 I would like Jenkins.createProjectFromXML to be part of ModifiableItemGroup interface

side effect is that adding such a method to an interface would break backward compatibility for plugins that implement this interface (even I don't know such a plugin but cloudbees folders)

 

option 1 :

use "duck typing" style and call createProjectFromXML by reflexion on ItemGroup if such a method exists

 

option 2 :

create a new interface to extend ModifiableItemGroup and add createProjectFromXML

 

option 3 : add method to ModifiableItemGroup

 

wdyt ? 

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: adding method to ModifiableItemGroup

nicolas de loof-2
done, created ModifiableTopLevelItemGroup interface.


2012/8/24 Sandell, Robert <[hidden email]>

Option 2

 

I’m a safety first kind of guy J

 

/B

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of nicolas de loof
Sent: den 23 augusti 2012 11:29
To: [hidden email]
Subject: adding method to ModifiableItemGroup

 

Hi folks,

 

for JENKINS-14902 I would like Jenkins.createProjectFromXML to be part of ModifiableItemGroup interface

side effect is that adding such a method to an interface would break backward compatibility for plugins that implement this interface (even I don't know such a plugin but cloudbees folders)

 

option 1 :

use "duck typing" style and call createProjectFromXML by reflexion on ItemGroup if such a method exists

 

option 2 :

create a new interface to extend ModifiableItemGroup and add createProjectFromXML

 

option 3 : add method to ModifiableItemGroup

 

wdyt ? 


Loading...