Re: [PR] [MRESOLVER-445] Introduce MutableSession to bridge between to two implementation [maven-resolver]

2023-11-30 Thread via GitHub


cstamas commented on PR #383:
URL: https://github.com/apache/maven-resolver/pull/383#issuecomment-1834327830

   Actually scratch all that above, I changed my mind. Soon will push almost 
totally opposite change to the commit that introduces MutableSession.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] [MRESOLVER-445] Introduce MutableSession to bridge between to two implementation [maven-resolver]

2023-11-30 Thread via GitHub


cstamas commented on PR #383:
URL: https://github.com/apache/maven-resolver/pull/383#issuecomment-1834282831

   @gnodet Yes, taking step back is actually the point here: to ease migration 
of code that used Resolver 1.x.
   
   My plan is following: DefaultRepositorySystemSession (DRSS) should be gone 
soon, let's say in 2.1 version. In a moment DRSS is gone, MutableSession loses 
it's role, and to be removed as well, because then the only way to create 
session becomes the RepositorySystem#createSessionBuilder() method. Basically 
at point, when DRSS is gone, the MutableSession has no role to fulfil (as 
currently all it does, is "bridges" between old code passing around DRSS and 
settings things on it, and new code that uses SessionBuilder.
   
   My only problem with this, is that am introducing an interface on public API 
in 2.0.0 that is meant to be gone in (let's say) 2.1. Should it be deprecated 
immediately as well? Maybe deprecate whole DRSS class as well (and not only def 
ctor)?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] [MRESOLVER-445] Introduce MutableSession to bridge between to two implementation [maven-resolver]

2023-11-30 Thread via GitHub


gnodet commented on PR #383:
URL: https://github.com/apache/maven-resolver/pull/383#issuecomment-1833775253

   @cstamas have you looked at the possibility to add mutators that would 
return a new `RepositorySession` instance instead of modifying the existing one 
in-place.  This would allow preserving the immutability, as this feels it goes 
a bit backward...
   
   If that does not work, it should be possible to implement a wrapper that 
would simply delegate to a mutable field.
   ```
   public class DefaultMutableSession implements MutableRepositorySession {
 private RepositorySession session;
 public DefaultMutableSession(RepositorySession session) {
   this.session = session;
 }
 public void setCache(RepositoryCache cache) {
   this.session = session.withCache(cache);
 }
 ...
   }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org