You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Jason van Zyl <ja...@maven.org> on 2007/09/01 23:53:40 UTC

Embedder Configuration Changes

Carlos,

Please put back the validation methods. I don't want to catch  
exception to validation user configuration. I want to be able to know  
exactly what's wrong. I don't need to throw an exception to find out  
the specific settings are not present and I'm using all these methods  
extensively.

Thanks,

Jason

----------------------------------------------------------
Jason van Zyl
Founder and PMC Chair, Apache Maven
jason at sonatype dot com
----------------------------------------------------------




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Embedder Configuration Changes

Posted by Jason van Zyl <ja...@maven.org>.
On 5 Sep 07, at 4:01 PM 5 Sep 07, Carlos Sanchez wrote:

>
>
> You can do
> DefaultMavenExecutionRequest request = new
> DefaultMavenExecutionRequest();
> request.setBaseDirectory( baseDirectory );
> request.Goals( goals );
>
> and then pass it around as MavenExecutionRequest. The fact that they
> are needed to create an instance doesn't mean that they are needed in
> the interface, it should be used to query for information, not to
> provide it.
>

I have already in cases because of coupling, required setting  
something beyond the requests instantiation. This optimally should  
not be the case but isn't the case right now.

> If for instance you want another implementation of the
> MavenExecutionRequest with some default values or one that will query
> other objects for them you are forcing the implementation to have
> empty setters.

Do you actually have one? All the use I've seen takes the request  
object and populates it according to their needs.

I'll answer the other questions in another thread.

Thanks,

Jason

----------------------------------------------------------
Jason van Zyl
Founder and PMC Chair, Apache Maven
jason at sonatype dot com
----------------------------------------------------------




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Embedder Configuration Changes

Posted by Carlos Sanchez <ca...@apache.org>.
On 9/5/07, Jason van Zyl <ja...@maven.org> wrote:
>
> On 5 Sep 07, at 2:49 PM 5 Sep 07, Carlos Sanchez wrote:
>
> > I don't quite get it, are you talking about the method
> > ConfigurationValidationResult validateConfiguration( Configuration
> > configuration )
> > in the embedder?
> >
> > I changed it to store the settings (if there is no error) and the
> > exception (if there is). Before there was no way to know what the
> > problem with the settings was.
> >
> > Couple of comments about the other changes made:
> >
> > * ConfigurationValidationResult
> > changed Throwable to Exception, although in other places like
> > MavenExecutionResult Throwable is being used
> >
> > * setters in interfaces
> > Do we really want setters in the interfaces (MavenExecutionRequest,
> > MavenExecutionResult,...). I don't think they should be there, only in
> > the implementations.
> >
> >
>
> You can't force people to do:
>
>              MavenExecutionRequest request = new
> DefaultMavenExecutionRequest()
>                  .setBaseDirectory( baseDirectory )
>                  .setGoals( goals );
>
> and not allow
>
>              MavenExecutionRequest request = new
> DefaultMavenExecutionRequest();
>            request.setBaseDirectory( baseDirectory ); // won't work
>             request.Goals( goals ); // won't work
>
> So yes, I do want them.

You can do
DefaultMavenExecutionRequest request = new
DefaultMavenExecutionRequest();
request.setBaseDirectory( baseDirectory );
request.Goals( goals );

and then pass it around as MavenExecutionRequest. The fact that they
are needed to create an instance doesn't mean that they are needed in
the interface, it should be used to query for information, not to
provide it.

If for instance you want another implementation of the
MavenExecutionRequest with some default values or one that will query
other objects for them you are forcing the implementation to have
empty setters.


what about the other questions?

>
>
> >
> >
> > On 9/1/07, Jason van Zyl <ja...@maven.org> wrote:
> >> Carlos,
> >>
> >> Please put back the validation methods. I don't want to catch
> >> exception to validation user configuration. I want to be able to know
> >> exactly what's wrong. I don't need to throw an exception to find out
> >> the specific settings are not present and I'm using all these methods
> >> extensively.
> >>
> >> Thanks,
> >>
> >> Jason
> >>
> >> ----------------------------------------------------------
> >> Jason van Zyl
> >> Founder and PMC Chair, Apache Maven
> >> jason at sonatype dot com
> >> ----------------------------------------------------------
> >>
> >>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: dev-help@maven.apache.org
> >>
> >>
> >
> >
> > --
> > I could give you my word as a Spaniard.
> > No good. I've known too many Spaniards.
> >                              -- The Princess Bride
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org
> >
>
> Thanks,
>
> Jason
>
> ----------------------------------------------------------
> Jason van Zyl
> Founder and PMC Chair, Apache Maven
> jason at sonatype dot com
> ----------------------------------------------------------
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>


-- 
I could give you my word as a Spaniard.
No good. I've known too many Spaniards.
                             -- The Princess Bride

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Embedder Configuration Changes

Posted by Jason van Zyl <ja...@maven.org>.
On 5 Sep 07, at 2:49 PM 5 Sep 07, Carlos Sanchez wrote:

> I don't quite get it, are you talking about the method
> ConfigurationValidationResult validateConfiguration( Configuration
> configuration )
> in the embedder?
>
> I changed it to store the settings (if there is no error) and the
> exception (if there is). Before there was no way to know what the
> problem with the settings was.
>
> Couple of comments about the other changes made:
>
> * ConfigurationValidationResult
> changed Throwable to Exception, although in other places like
> MavenExecutionResult Throwable is being used
>
> * setters in interfaces
> Do we really want setters in the interfaces (MavenExecutionRequest,
> MavenExecutionResult,...). I don't think they should be there, only in
> the implementations.
>
>

You can't force people to do:

             MavenExecutionRequest request = new  
DefaultMavenExecutionRequest()
                 .setBaseDirectory( baseDirectory )
                 .setGoals( goals );

and not allow

             MavenExecutionRequest request = new  
DefaultMavenExecutionRequest();		
	   request.setBaseDirectory( baseDirectory ); // won't work
            request.Goals( goals ); // won't work

So yes, I do want them.


>
>
> On 9/1/07, Jason van Zyl <ja...@maven.org> wrote:
>> Carlos,
>>
>> Please put back the validation methods. I don't want to catch
>> exception to validation user configuration. I want to be able to know
>> exactly what's wrong. I don't need to throw an exception to find out
>> the specific settings are not present and I'm using all these methods
>> extensively.
>>
>> Thanks,
>>
>> Jason
>>
>> ----------------------------------------------------------
>> Jason van Zyl
>> Founder and PMC Chair, Apache Maven
>> jason at sonatype dot com
>> ----------------------------------------------------------
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>>
>>
>
>
> -- 
> I could give you my word as a Spaniard.
> No good. I've known too many Spaniards.
>                              -- The Princess Bride
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>

Thanks,

Jason

----------------------------------------------------------
Jason van Zyl
Founder and PMC Chair, Apache Maven
jason at sonatype dot com
----------------------------------------------------------




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Embedder Configuration Changes

Posted by Carlos Sanchez <ca...@apache.org>.
I don't quite get it, are you talking about the method
ConfigurationValidationResult validateConfiguration( Configuration
configuration )
in the embedder?

I changed it to store the settings (if there is no error) and the
exception (if there is). Before there was no way to know what the
problem with the settings was.

Couple of comments about the other changes made:

* ConfigurationValidationResult
changed Throwable to Exception, although in other places like
MavenExecutionResult Throwable is being used

* setters in interfaces
Do we really want setters in the interfaces (MavenExecutionRequest,
MavenExecutionResult,...). I don't think they should be there, only in
the implementations.




On 9/1/07, Jason van Zyl <ja...@maven.org> wrote:
> Carlos,
>
> Please put back the validation methods. I don't want to catch
> exception to validation user configuration. I want to be able to know
> exactly what's wrong. I don't need to throw an exception to find out
> the specific settings are not present and I'm using all these methods
> extensively.
>
> Thanks,
>
> Jason
>
> ----------------------------------------------------------
> Jason van Zyl
> Founder and PMC Chair, Apache Maven
> jason at sonatype dot com
> ----------------------------------------------------------
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>


-- 
I could give you my word as a Spaniard.
No good. I've known too many Spaniards.
                             -- The Princess Bride

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org