You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by Gary Gregory <ga...@gmail.com> on 2016/08/20 17:16:59 UTC

ThreadContextMap2

Hi All:

Now that we have ThreadContextMap2:

Why don't we do ThreadContextMap2 extends Map<String, String>?

Why did ThreadContextMap initially not extends Map<String, String>?

Gary

-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition
<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: ThreadContextMap2

Posted by Gary Gregory <ga...@gmail.com>.
TCM2 extending TCM cannot affect BC. Now, some classes now implement TCM2,
which should also be OK.

Gary

On Tue, Aug 23, 2016 at 12:20 PM, Matt Sicker <bo...@gmail.com> wrote:

> I know we added TCM2 to preserve backwards compatibility. By making TCM2
> extend TCM and the other changes, this won't affect binary or source
> compatibility, will it?
>
> On 23 August 2016 at 13:58, Gary Gregory <ga...@gmail.com> wrote:
>
>> I made the change for ThreadContextMap2 to extend ThreadContextMap
>> (yesterday).
>>
>> Gary
>>
>> On Mon, Aug 22, 2016 at 1:48 PM, Gary Gregory <ga...@gmail.com>
>> wrote:
>>
>>> Why doesn't ThreadContextMap2 extend ThreadContextMap? This feels highly
>>> unusual.
>>>
>>> Gary
>>>
>>> On Sat, Aug 20, 2016 at 5:10 PM, Gary Gregory <ga...@gmail.com>
>>> wrote:
>>>
>>>>
>>>> On Aug 20, 2016 4:47 PM, "Remko Popma" <re...@gmail.com> wrote:
>>>> >
>>>> > Do you have anything specific in mind?
>>>> > Otherwise something may come out of my ongoing work for LOG4J2-1010,
>>>> LOG4J2-1447, LOG4J2-1349, so I would prefer to wait until that takes shape.
>>>>
>>>> Nothing specific since we have putAll in there now.
>>>>
>>>> Gary
>>>>
>>>> >
>>>> > On Sun, Aug 21, 2016 at 8:04 AM, Gary Gregory <ga...@gmail.com>
>>>> wrote:
>>>> >>
>>>> >> All right, topic closed for Map then. Since we have TCM2, now is the
>>>> time to add anything else. Check?
>>>> >>
>>>> >> Gary
>>>> >>
>>>> >>
>>>> >> On Aug 20, 2016 3:05 PM, "Remko Popma" <re...@gmail.com>
>>>> wrote:
>>>> >>>
>>>> >>> I agree with Ralph.
>>>> >>>
>>>> >>> I am working on custom implementations of ThreadContextMap
>>>> (LOG4J2-1010, LOG4J2-1447, LOG4J2-1349) and I'm very glad the interface is
>>>> small.
>>>> >>>
>>>> >>> My rule of thumb for API design is YAGNI: don't add until you
>>>> really need it, otherwise it'll get in the way.
>>>> >>>
>>>> >>> Remko
>>>> >>>
>>>> >>> Sent from my iPhone
>>>> >>>
>>>> >>> On 2016/08/21, at 4:59, Ralph Goers <ra...@dslextreme.com>
>>>> wrote:
>>>> >>>
>>>> >>>> 1. Why?
>>>> >>>> 2. Why do you need to implement equals and hashcode? What other
>>>> map are you going to compare it with?
>>>> >>>> 2. Which version? Java 8 added a bunch of new methods.
>>>> >>>>
>>>> >>>> I don’t really view the thread context map as a Map. It is really
>>>> nothing more than a bunch of keys and values that I want to store that are
>>>> probably not really directly related with each other, much like HTTP
>>>> session attributes.  When there are cases of wanting to iterate through the
>>>> whole map we first get a copy of it.
>>>> >>>>
>>>> >>>> Ralph
>>>> >>>>
>>>> >>>>> On Aug 20, 2016, at 11:01 AM, Gary Gregory <
>>>> garydgregory@gmail.com> wrote:
>>>> >>>>>
>>>> >>>>> Fair enough.
>>>> >>>>>
>>>> >>>>> I am wondering if there is a design reason not to implement Map
>>>> now that we have the opportunity with the TCM2 interface. I'd take a crack
>>>> at it.
>>>> >>>>>
>>>> >>>>> Gary
>>>> >>>>>
>>>> >>>>>
>>>> >>>>> On Aug 20, 2016 10:39 AM, "Ralph Goers" <
>>>> ralph.goers@dslextreme.com> wrote:
>>>> >>>>>>
>>>> >>>>>> Because Map has a lot more methods that weren’t needed and I
>>>> didn’t want to implement?
>>>> >>>>>>
>>>> >>>>>> Ralph
>>>> >>>>>>
>>>> >>>>>>> On Aug 20, 2016, at 10:16 AM, Gary Gregory <
>>>> garydgregory@gmail.com> wrote:
>>>> >>>>>>>
>>>> >>>>>>> Hi All:
>>>> >>>>>>>
>>>> >>>>>>> Now that we have ThreadContextMap2:
>>>> >>>>>>>
>>>> >>>>>>> Why don't we do ThreadContextMap2 extends Map<String, String>?
>>>> >>>>>>>
>>>> >>>>>>> Why did ThreadContextMap initially not extends Map<String,
>>>> String>?
>>>> >>>>>>>
>>>> >>>>>>> Gary
>>>> >>>>>>>
>>>> >>>>>>> --
>>>> >>>>>>> E-Mail: garydgregory@gmail.com | ggregory@apache.org
>>>> >>>>>>> Java Persistence with Hibernate, Second Edition
>>>> >>>>>>> JUnit in Action, Second Edition
>>>> >>>>>>> Spring Batch in Action
>>>> >>>>>>> Blog: http://garygregory.wordpress.com
>>>> >>>>>>> Home: http://garygregory.com/
>>>> >>>>>>> Tweet! http://twitter.com/GaryGregory
>>>> >>>>>>
>>>> >>>>>>
>>>> >>>>
>>>> >
>>>>
>>>>
>>>
>>>
>>> --
>>> E-Mail: garydgregory@gmail.com | ggregory@apache.org
>>> Java Persistence with Hibernate, Second Edition
>>> <http://www.manning.com/bauer3/>
>>> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
>>> Spring Batch in Action <http://www.manning.com/templier/>
>>> Blog: http://garygregory.wordpress.com
>>> Home: http://garygregory.com/
>>> Tweet! http://twitter.com/GaryGregory
>>>
>>
>>
>>
>> --
>> E-Mail: garydgregory@gmail.com | ggregory@apache.org
>> Java Persistence with Hibernate, Second Edition
>> <http://www.manning.com/bauer3/>
>> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
>> Spring Batch in Action <http://www.manning.com/templier/>
>> Blog: http://garygregory.wordpress.com
>> Home: http://garygregory.com/
>> Tweet! http://twitter.com/GaryGregory
>>
>
>
>
> --
> Matt Sicker <bo...@gmail.com>
>



-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition
<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: ThreadContextMap2

Posted by Matt Sicker <bo...@gmail.com>.
I know we added TCM2 to preserve backwards compatibility. By making TCM2
extend TCM and the other changes, this won't affect binary or source
compatibility, will it?

On 23 August 2016 at 13:58, Gary Gregory <ga...@gmail.com> wrote:

> I made the change for ThreadContextMap2 to extend ThreadContextMap
> (yesterday).
>
> Gary
>
> On Mon, Aug 22, 2016 at 1:48 PM, Gary Gregory <ga...@gmail.com>
> wrote:
>
>> Why doesn't ThreadContextMap2 extend ThreadContextMap? This feels highly
>> unusual.
>>
>> Gary
>>
>> On Sat, Aug 20, 2016 at 5:10 PM, Gary Gregory <ga...@gmail.com>
>> wrote:
>>
>>>
>>> On Aug 20, 2016 4:47 PM, "Remko Popma" <re...@gmail.com> wrote:
>>> >
>>> > Do you have anything specific in mind?
>>> > Otherwise something may come out of my ongoing work for LOG4J2-1010,
>>> LOG4J2-1447, LOG4J2-1349, so I would prefer to wait until that takes shape.
>>>
>>> Nothing specific since we have putAll in there now.
>>>
>>> Gary
>>>
>>> >
>>> > On Sun, Aug 21, 2016 at 8:04 AM, Gary Gregory <ga...@gmail.com>
>>> wrote:
>>> >>
>>> >> All right, topic closed for Map then. Since we have TCM2, now is the
>>> time to add anything else. Check?
>>> >>
>>> >> Gary
>>> >>
>>> >>
>>> >> On Aug 20, 2016 3:05 PM, "Remko Popma" <re...@gmail.com> wrote:
>>> >>>
>>> >>> I agree with Ralph.
>>> >>>
>>> >>> I am working on custom implementations of ThreadContextMap
>>> (LOG4J2-1010, LOG4J2-1447, LOG4J2-1349) and I'm very glad the interface is
>>> small.
>>> >>>
>>> >>> My rule of thumb for API design is YAGNI: don't add until you really
>>> need it, otherwise it'll get in the way.
>>> >>>
>>> >>> Remko
>>> >>>
>>> >>> Sent from my iPhone
>>> >>>
>>> >>> On 2016/08/21, at 4:59, Ralph Goers <ra...@dslextreme.com>
>>> wrote:
>>> >>>
>>> >>>> 1. Why?
>>> >>>> 2. Why do you need to implement equals and hashcode? What other map
>>> are you going to compare it with?
>>> >>>> 2. Which version? Java 8 added a bunch of new methods.
>>> >>>>
>>> >>>> I don’t really view the thread context map as a Map. It is really
>>> nothing more than a bunch of keys and values that I want to store that are
>>> probably not really directly related with each other, much like HTTP
>>> session attributes.  When there are cases of wanting to iterate through the
>>> whole map we first get a copy of it.
>>> >>>>
>>> >>>> Ralph
>>> >>>>
>>> >>>>> On Aug 20, 2016, at 11:01 AM, Gary Gregory <ga...@gmail.com>
>>> wrote:
>>> >>>>>
>>> >>>>> Fair enough.
>>> >>>>>
>>> >>>>> I am wondering if there is a design reason not to implement Map
>>> now that we have the opportunity with the TCM2 interface. I'd take a crack
>>> at it.
>>> >>>>>
>>> >>>>> Gary
>>> >>>>>
>>> >>>>>
>>> >>>>> On Aug 20, 2016 10:39 AM, "Ralph Goers" <
>>> ralph.goers@dslextreme.com> wrote:
>>> >>>>>>
>>> >>>>>> Because Map has a lot more methods that weren’t needed and I
>>> didn’t want to implement?
>>> >>>>>>
>>> >>>>>> Ralph
>>> >>>>>>
>>> >>>>>>> On Aug 20, 2016, at 10:16 AM, Gary Gregory <
>>> garydgregory@gmail.com> wrote:
>>> >>>>>>>
>>> >>>>>>> Hi All:
>>> >>>>>>>
>>> >>>>>>> Now that we have ThreadContextMap2:
>>> >>>>>>>
>>> >>>>>>> Why don't we do ThreadContextMap2 extends Map<String, String>?
>>> >>>>>>>
>>> >>>>>>> Why did ThreadContextMap initially not extends Map<String,
>>> String>?
>>> >>>>>>>
>>> >>>>>>> Gary
>>> >>>>>>>
>>> >>>>>>> --
>>> >>>>>>> E-Mail: garydgregory@gmail.com | ggregory@apache.org
>>> >>>>>>> Java Persistence with Hibernate, Second Edition
>>> >>>>>>> JUnit in Action, Second Edition
>>> >>>>>>> Spring Batch in Action
>>> >>>>>>> Blog: http://garygregory.wordpress.com
>>> >>>>>>> Home: http://garygregory.com/
>>> >>>>>>> Tweet! http://twitter.com/GaryGregory
>>> >>>>>>
>>> >>>>>>
>>> >>>>
>>> >
>>>
>>>
>>
>>
>> --
>> E-Mail: garydgregory@gmail.com | ggregory@apache.org
>> Java Persistence with Hibernate, Second Edition
>> <http://www.manning.com/bauer3/>
>> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
>> Spring Batch in Action <http://www.manning.com/templier/>
>> Blog: http://garygregory.wordpress.com
>> Home: http://garygregory.com/
>> Tweet! http://twitter.com/GaryGregory
>>
>
>
>
> --
> E-Mail: garydgregory@gmail.com | ggregory@apache.org
> Java Persistence with Hibernate, Second Edition
> <http://www.manning.com/bauer3/>
> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
> Spring Batch in Action <http://www.manning.com/templier/>
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory
>



-- 
Matt Sicker <bo...@gmail.com>

Re: ThreadContextMap2

Posted by Gary Gregory <ga...@gmail.com>.
I made the change for ThreadContextMap2 to extend ThreadContextMap
(yesterday).

Gary

On Mon, Aug 22, 2016 at 1:48 PM, Gary Gregory <ga...@gmail.com>
wrote:

> Why doesn't ThreadContextMap2 extend ThreadContextMap? This feels highly
> unusual.
>
> Gary
>
> On Sat, Aug 20, 2016 at 5:10 PM, Gary Gregory <ga...@gmail.com>
> wrote:
>
>>
>> On Aug 20, 2016 4:47 PM, "Remko Popma" <re...@gmail.com> wrote:
>> >
>> > Do you have anything specific in mind?
>> > Otherwise something may come out of my ongoing work for LOG4J2-1010,
>> LOG4J2-1447, LOG4J2-1349, so I would prefer to wait until that takes shape.
>>
>> Nothing specific since we have putAll in there now.
>>
>> Gary
>>
>> >
>> > On Sun, Aug 21, 2016 at 8:04 AM, Gary Gregory <ga...@gmail.com>
>> wrote:
>> >>
>> >> All right, topic closed for Map then. Since we have TCM2, now is the
>> time to add anything else. Check?
>> >>
>> >> Gary
>> >>
>> >>
>> >> On Aug 20, 2016 3:05 PM, "Remko Popma" <re...@gmail.com> wrote:
>> >>>
>> >>> I agree with Ralph.
>> >>>
>> >>> I am working on custom implementations of ThreadContextMap
>> (LOG4J2-1010, LOG4J2-1447, LOG4J2-1349) and I'm very glad the interface is
>> small.
>> >>>
>> >>> My rule of thumb for API design is YAGNI: don't add until you really
>> need it, otherwise it'll get in the way.
>> >>>
>> >>> Remko
>> >>>
>> >>> Sent from my iPhone
>> >>>
>> >>> On 2016/08/21, at 4:59, Ralph Goers <ra...@dslextreme.com>
>> wrote:
>> >>>
>> >>>> 1. Why?
>> >>>> 2. Why do you need to implement equals and hashcode? What other map
>> are you going to compare it with?
>> >>>> 2. Which version? Java 8 added a bunch of new methods.
>> >>>>
>> >>>> I don’t really view the thread context map as a Map. It is really
>> nothing more than a bunch of keys and values that I want to store that are
>> probably not really directly related with each other, much like HTTP
>> session attributes.  When there are cases of wanting to iterate through the
>> whole map we first get a copy of it.
>> >>>>
>> >>>> Ralph
>> >>>>
>> >>>>> On Aug 20, 2016, at 11:01 AM, Gary Gregory <ga...@gmail.com>
>> wrote:
>> >>>>>
>> >>>>> Fair enough.
>> >>>>>
>> >>>>> I am wondering if there is a design reason not to implement Map now
>> that we have the opportunity with the TCM2 interface. I'd take a crack at
>> it.
>> >>>>>
>> >>>>> Gary
>> >>>>>
>> >>>>>
>> >>>>> On Aug 20, 2016 10:39 AM, "Ralph Goers" <ra...@dslextreme.com>
>> wrote:
>> >>>>>>
>> >>>>>> Because Map has a lot more methods that weren’t needed and I
>> didn’t want to implement?
>> >>>>>>
>> >>>>>> Ralph
>> >>>>>>
>> >>>>>>> On Aug 20, 2016, at 10:16 AM, Gary Gregory <
>> garydgregory@gmail.com> wrote:
>> >>>>>>>
>> >>>>>>> Hi All:
>> >>>>>>>
>> >>>>>>> Now that we have ThreadContextMap2:
>> >>>>>>>
>> >>>>>>> Why don't we do ThreadContextMap2 extends Map<String, String>?
>> >>>>>>>
>> >>>>>>> Why did ThreadContextMap initially not extends Map<String,
>> String>?
>> >>>>>>>
>> >>>>>>> Gary
>> >>>>>>>
>> >>>>>>> --
>> >>>>>>> E-Mail: garydgregory@gmail.com | ggregory@apache.org
>> >>>>>>> Java Persistence with Hibernate, Second Edition
>> >>>>>>> JUnit in Action, Second Edition
>> >>>>>>> Spring Batch in Action
>> >>>>>>> Blog: http://garygregory.wordpress.com
>> >>>>>>> Home: http://garygregory.com/
>> >>>>>>> Tweet! http://twitter.com/GaryGregory
>> >>>>>>
>> >>>>>>
>> >>>>
>> >
>>
>>
>
>
> --
> E-Mail: garydgregory@gmail.com | ggregory@apache.org
> Java Persistence with Hibernate, Second Edition
> <http://www.manning.com/bauer3/>
> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
> Spring Batch in Action <http://www.manning.com/templier/>
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory
>



-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition
<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: ThreadContextMap2

Posted by Gary Gregory <ga...@gmail.com>.
Why doesn't ThreadContextMap2 extend ThreadContextMap? This feels highly
unusual.

Gary

On Sat, Aug 20, 2016 at 5:10 PM, Gary Gregory <ga...@gmail.com>
wrote:

>
> On Aug 20, 2016 4:47 PM, "Remko Popma" <re...@gmail.com> wrote:
> >
> > Do you have anything specific in mind?
> > Otherwise something may come out of my ongoing work for LOG4J2-1010,
> LOG4J2-1447, LOG4J2-1349, so I would prefer to wait until that takes shape.
>
> Nothing specific since we have putAll in there now.
>
> Gary
>
> >
> > On Sun, Aug 21, 2016 at 8:04 AM, Gary Gregory <ga...@gmail.com>
> wrote:
> >>
> >> All right, topic closed for Map then. Since we have TCM2, now is the
> time to add anything else. Check?
> >>
> >> Gary
> >>
> >>
> >> On Aug 20, 2016 3:05 PM, "Remko Popma" <re...@gmail.com> wrote:
> >>>
> >>> I agree with Ralph.
> >>>
> >>> I am working on custom implementations of ThreadContextMap
> (LOG4J2-1010, LOG4J2-1447, LOG4J2-1349) and I'm very glad the interface is
> small.
> >>>
> >>> My rule of thumb for API design is YAGNI: don't add until you really
> need it, otherwise it'll get in the way.
> >>>
> >>> Remko
> >>>
> >>> Sent from my iPhone
> >>>
> >>> On 2016/08/21, at 4:59, Ralph Goers <ra...@dslextreme.com>
> wrote:
> >>>
> >>>> 1. Why?
> >>>> 2. Why do you need to implement equals and hashcode? What other map
> are you going to compare it with?
> >>>> 2. Which version? Java 8 added a bunch of new methods.
> >>>>
> >>>> I don’t really view the thread context map as a Map. It is really
> nothing more than a bunch of keys and values that I want to store that are
> probably not really directly related with each other, much like HTTP
> session attributes.  When there are cases of wanting to iterate through the
> whole map we first get a copy of it.
> >>>>
> >>>> Ralph
> >>>>
> >>>>> On Aug 20, 2016, at 11:01 AM, Gary Gregory <ga...@gmail.com>
> wrote:
> >>>>>
> >>>>> Fair enough.
> >>>>>
> >>>>> I am wondering if there is a design reason not to implement Map now
> that we have the opportunity with the TCM2 interface. I'd take a crack at
> it.
> >>>>>
> >>>>> Gary
> >>>>>
> >>>>>
> >>>>> On Aug 20, 2016 10:39 AM, "Ralph Goers" <ra...@dslextreme.com>
> wrote:
> >>>>>>
> >>>>>> Because Map has a lot more methods that weren’t needed and I didn’t
> want to implement?
> >>>>>>
> >>>>>> Ralph
> >>>>>>
> >>>>>>> On Aug 20, 2016, at 10:16 AM, Gary Gregory <ga...@gmail.com>
> wrote:
> >>>>>>>
> >>>>>>> Hi All:
> >>>>>>>
> >>>>>>> Now that we have ThreadContextMap2:
> >>>>>>>
> >>>>>>> Why don't we do ThreadContextMap2 extends Map<String, String>?
> >>>>>>>
> >>>>>>> Why did ThreadContextMap initially not extends Map<String, String>?
> >>>>>>>
> >>>>>>> Gary
> >>>>>>>
> >>>>>>> --
> >>>>>>> E-Mail: garydgregory@gmail.com | ggregory@apache.org
> >>>>>>> Java Persistence with Hibernate, Second Edition
> >>>>>>> JUnit in Action, Second Edition
> >>>>>>> Spring Batch in Action
> >>>>>>> Blog: http://garygregory.wordpress.com
> >>>>>>> Home: http://garygregory.com/
> >>>>>>> Tweet! http://twitter.com/GaryGregory
> >>>>>>
> >>>>>>
> >>>>
> >
>
>


-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition
<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: ThreadContextMap2

Posted by Gary Gregory <ga...@gmail.com>.
On Aug 20, 2016 4:47 PM, "Remko Popma" <re...@gmail.com> wrote:
>
> Do you have anything specific in mind?
> Otherwise something may come out of my ongoing work for LOG4J2-1010,
LOG4J2-1447, LOG4J2-1349, so I would prefer to wait until that takes shape.

Nothing specific since we have putAll in there now.

Gary
>
> On Sun, Aug 21, 2016 at 8:04 AM, Gary Gregory <ga...@gmail.com>
wrote:
>>
>> All right, topic closed for Map then. Since we have TCM2, now is the
time to add anything else. Check?
>>
>> Gary
>>
>>
>> On Aug 20, 2016 3:05 PM, "Remko Popma" <re...@gmail.com> wrote:
>>>
>>> I agree with Ralph.
>>>
>>> I am working on custom implementations of ThreadContextMap
(LOG4J2-1010, LOG4J2-1447, LOG4J2-1349) and I'm very glad the interface is
small.
>>>
>>> My rule of thumb for API design is YAGNI: don't add until you really
need it, otherwise it'll get in the way.
>>>
>>> Remko
>>>
>>> Sent from my iPhone
>>>
>>> On 2016/08/21, at 4:59, Ralph Goers <ra...@dslextreme.com> wrote:
>>>
>>>> 1. Why?
>>>> 2. Why do you need to implement equals and hashcode? What other map
are you going to compare it with?
>>>> 2. Which version? Java 8 added a bunch of new methods.
>>>>
>>>> I don’t really view the thread context map as a Map. It is really
nothing more than a bunch of keys and values that I want to store that are
probably not really directly related with each other, much like HTTP
session attributes.  When there are cases of wanting to iterate through the
whole map we first get a copy of it.
>>>>
>>>> Ralph
>>>>
>>>>> On Aug 20, 2016, at 11:01 AM, Gary Gregory <ga...@gmail.com>
wrote:
>>>>>
>>>>> Fair enough.
>>>>>
>>>>> I am wondering if there is a design reason not to implement Map now
that we have the opportunity with the TCM2 interface. I'd take a crack at
it.
>>>>>
>>>>> Gary
>>>>>
>>>>>
>>>>> On Aug 20, 2016 10:39 AM, "Ralph Goers" <ra...@dslextreme.com>
wrote:
>>>>>>
>>>>>> Because Map has a lot more methods that weren’t needed and I didn’t
want to implement?
>>>>>>
>>>>>> Ralph
>>>>>>
>>>>>>> On Aug 20, 2016, at 10:16 AM, Gary Gregory <ga...@gmail.com>
wrote:
>>>>>>>
>>>>>>> Hi All:
>>>>>>>
>>>>>>> Now that we have ThreadContextMap2:
>>>>>>>
>>>>>>> Why don't we do ThreadContextMap2 extends Map<String, String>?
>>>>>>>
>>>>>>> Why did ThreadContextMap initially not extends Map<String, String>?
>>>>>>>
>>>>>>> Gary
>>>>>>>
>>>>>>> --
>>>>>>> E-Mail: garydgregory@gmail.com | ggregory@apache.org
>>>>>>> Java Persistence with Hibernate, Second Edition
>>>>>>> JUnit in Action, Second Edition
>>>>>>> Spring Batch in Action
>>>>>>> Blog: http://garygregory.wordpress.com
>>>>>>> Home: http://garygregory.com/
>>>>>>> Tweet! http://twitter.com/GaryGregory
>>>>>>
>>>>>>
>>>>
>

Re: ThreadContextMap2

Posted by Remko Popma <re...@gmail.com>.
Do you have anything specific in mind?
Otherwise something may come out of my ongoing work for LOG4J2-1010,
LOG4J2-1447, LOG4J2-1349, so I would prefer to wait until that takes shape.

On Sun, Aug 21, 2016 at 8:04 AM, Gary Gregory <ga...@gmail.com>
wrote:

> All right, topic closed for Map then. Since we have TCM2, now is the time
> to add anything else. Check?
>
> Gary
>
> On Aug 20, 2016 3:05 PM, "Remko Popma" <re...@gmail.com> wrote:
>
>> I agree with Ralph.
>>
>> I am working on custom implementations of ThreadContextMap (LOG4J2-1010,
>> LOG4J2-1447, LOG4J2-1349) and I'm very glad the interface is small.
>>
>> My rule of thumb for API design is YAGNI: don't add until you really need
>> it, otherwise it'll get in the way.
>>
>> Remko
>>
>> Sent from my iPhone
>>
>> On 2016/08/21, at 4:59, Ralph Goers <ra...@dslextreme.com> wrote:
>>
>> 1. Why?
>> 2. Why do you need to implement equals and hashcode? What other map are
>> you going to compare it with?
>> 2. Which version? Java 8 added a bunch of new methods.
>>
>> I don’t really view the thread context map as a Map. It is really nothing
>> more than a bunch of keys and values that I want to store that are probably
>> not really directly related with each other, much like HTTP session
>> attributes.  When there are cases of wanting to iterate through the whole
>> map we first get a copy of it.
>>
>> Ralph
>>
>> On Aug 20, 2016, at 11:01 AM, Gary Gregory <ga...@gmail.com>
>> wrote:
>>
>> Fair enough.
>>
>> I am wondering if there is a design reason not to implement Map now that
>> we have the opportunity with the TCM2 interface. I'd take a crack at it.
>>
>> Gary
>>
>> On Aug 20, 2016 10:39 AM, "Ralph Goers" <ra...@dslextreme.com>
>> wrote:
>>
>>> Because Map has a lot more methods that weren’t needed and I didn’t want
>>> to implement?
>>>
>>> Ralph
>>>
>>> On Aug 20, 2016, at 10:16 AM, Gary Gregory <ga...@gmail.com>
>>> wrote:
>>>
>>> Hi All:
>>>
>>> Now that we have ThreadContextMap2:
>>>
>>> Why don't we do ThreadContextMap2 extends Map<String, String>?
>>>
>>> Why did ThreadContextMap initially not extends Map<String, String>?
>>>
>>> Gary
>>>
>>> --
>>> E-Mail: garydgregory@gmail.com | ggregory@apache.org
>>> Java Persistence with Hibernate, Second Edition
>>> <http://www.manning.com/bauer3/>
>>> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
>>> Spring Batch in Action <http://www.manning.com/templier/>
>>> Blog: http://garygregory.wordpress.com
>>> Home: http://garygregory.com/
>>> Tweet! http://twitter.com/GaryGregory
>>>
>>>
>>>
>>

Re: ThreadContextMap2

Posted by Gary Gregory <ga...@gmail.com>.
All right, topic closed for Map then. Since we have TCM2, now is the time
to add anything else. Check?

Gary

On Aug 20, 2016 3:05 PM, "Remko Popma" <re...@gmail.com> wrote:

> I agree with Ralph.
>
> I am working on custom implementations of ThreadContextMap (LOG4J2-1010,
> LOG4J2-1447, LOG4J2-1349) and I'm very glad the interface is small.
>
> My rule of thumb for API design is YAGNI: don't add until you really need
> it, otherwise it'll get in the way.
>
> Remko
>
> Sent from my iPhone
>
> On 2016/08/21, at 4:59, Ralph Goers <ra...@dslextreme.com> wrote:
>
> 1. Why?
> 2. Why do you need to implement equals and hashcode? What other map are
> you going to compare it with?
> 2. Which version? Java 8 added a bunch of new methods.
>
> I don’t really view the thread context map as a Map. It is really nothing
> more than a bunch of keys and values that I want to store that are probably
> not really directly related with each other, much like HTTP session
> attributes.  When there are cases of wanting to iterate through the whole
> map we first get a copy of it.
>
> Ralph
>
> On Aug 20, 2016, at 11:01 AM, Gary Gregory <ga...@gmail.com> wrote:
>
> Fair enough.
>
> I am wondering if there is a design reason not to implement Map now that
> we have the opportunity with the TCM2 interface. I'd take a crack at it.
>
> Gary
>
> On Aug 20, 2016 10:39 AM, "Ralph Goers" <ra...@dslextreme.com>
> wrote:
>
>> Because Map has a lot more methods that weren’t needed and I didn’t want
>> to implement?
>>
>> Ralph
>>
>> On Aug 20, 2016, at 10:16 AM, Gary Gregory <ga...@gmail.com>
>> wrote:
>>
>> Hi All:
>>
>> Now that we have ThreadContextMap2:
>>
>> Why don't we do ThreadContextMap2 extends Map<String, String>?
>>
>> Why did ThreadContextMap initially not extends Map<String, String>?
>>
>> Gary
>>
>> --
>> E-Mail: garydgregory@gmail.com | ggregory@apache.org
>> Java Persistence with Hibernate, Second Edition
>> <http://www.manning.com/bauer3/>
>> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
>> Spring Batch in Action <http://www.manning.com/templier/>
>> Blog: http://garygregory.wordpress.com
>> Home: http://garygregory.com/
>> Tweet! http://twitter.com/GaryGregory
>>
>>
>>
>

Re: ThreadContextMap2

Posted by Remko Popma <re...@gmail.com>.
I agree with Ralph. 

I am working on custom implementations of ThreadContextMap (LOG4J2-1010, LOG4J2-1447, LOG4J2-1349) and I'm very glad the interface is small. 

My rule of thumb for API design is YAGNI: don't add until you really need it, otherwise it'll get in the way. 

Remko

Sent from my iPhone

> On 2016/08/21, at 4:59, Ralph Goers <ra...@dslextreme.com> wrote:
> 
> 1. Why?  
> 2. Why do you need to implement equals and hashcode? What other map are you going to compare it with?
> 2. Which version? Java 8 added a bunch of new methods.
> 
> I don’t really view the thread context map as a Map. It is really nothing more than a bunch of keys and values that I want to store that are probably not really directly related with each other, much like HTTP session attributes.  When there are cases of wanting to iterate through the whole map we first get a copy of it.
> 
> Ralph
> 
>> On Aug 20, 2016, at 11:01 AM, Gary Gregory <ga...@gmail.com> wrote:
>> 
>> Fair enough.
>> 
>> I am wondering if there is a design reason not to implement Map now that we have the opportunity with the TCM2 interface. I'd take a crack at it.
>> 
>> Gary
>> 
>> 
>>> On Aug 20, 2016 10:39 AM, "Ralph Goers" <ra...@dslextreme.com> wrote:
>>> Because Map has a lot more methods that weren’t needed and I didn’t want to implement?
>>> 
>>> Ralph
>>> 
>>>> On Aug 20, 2016, at 10:16 AM, Gary Gregory <ga...@gmail.com> wrote:
>>>> 
>>>> Hi All:
>>>> 
>>>> Now that we have ThreadContextMap2:
>>>> 
>>>> Why don't we do ThreadContextMap2 extends Map<String, String>?
>>>> 
>>>> Why did ThreadContextMap initially not extends Map<String, String>?
>>>> 
>>>> Gary
>>>> 
>>>> -- 
>>>> E-Mail: garydgregory@gmail.com | ggregory@apache.org 
>>>> Java Persistence with Hibernate, Second Edition
>>>> JUnit in Action, Second Edition
>>>> Spring Batch in Action
>>>> Blog: http://garygregory.wordpress.com 
>>>> Home: http://garygregory.com/
>>>> Tweet! http://twitter.com/GaryGregory
> 

Re: ThreadContextMap2

Posted by Ralph Goers <ra...@dslextreme.com>.
1. Why?  
2. Why do you need to implement equals and hashcode? What other map are you going to compare it with?
2. Which version? Java 8 added a bunch of new methods.

I don’t really view the thread context map as a Map. It is really nothing more than a bunch of keys and values that I want to store that are probably not really directly related with each other, much like HTTP session attributes.  When there are cases of wanting to iterate through the whole map we first get a copy of it.

Ralph

> On Aug 20, 2016, at 11:01 AM, Gary Gregory <ga...@gmail.com> wrote:
> 
> Fair enough.
> 
> I am wondering if there is a design reason not to implement Map now that we have the opportunity with the TCM2 interface. I'd take a crack at it.
> 
> Gary
> 
> 
> On Aug 20, 2016 10:39 AM, "Ralph Goers" <ralph.goers@dslextreme.com <ma...@dslextreme.com>> wrote:
> Because Map has a lot more methods that weren’t needed and I didn’t want to implement?
> 
> Ralph
> 
>> On Aug 20, 2016, at 10:16 AM, Gary Gregory <garydgregory@gmail.com <ma...@gmail.com>> wrote:
>> 
>> Hi All:
>> 
>> Now that we have ThreadContextMap2:
>> 
>> Why don't we do ThreadContextMap2 extends Map<String, String>?
>> 
>> Why did ThreadContextMap initially not extends Map<String, String>?
>> 
>> Gary
>> 
>> -- 
>> E-Mail: garydgregory@gmail.com <ma...@gmail.com> | ggregory@apache.org  <ma...@apache.org>
>> Java Persistence with Hibernate, Second Edition <http://www.manning.com/bauer3/>
>> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
>> Spring Batch in Action <http://www.manning.com/templier/>
>> Blog: http://garygregory.wordpress.com <http://garygregory.wordpress.com/> 
>> Home: http://garygregory.com/ <http://garygregory.com/>
>> Tweet! http://twitter.com/GaryGregory <http://twitter.com/GaryGregory>


Re: ThreadContextMap2

Posted by Gary Gregory <ga...@gmail.com>.
Fair enough.

I am wondering if there is a design reason not to implement Map now that we
have the opportunity with the TCM2 interface. I'd take a crack at it.

Gary

On Aug 20, 2016 10:39 AM, "Ralph Goers" <ra...@dslextreme.com> wrote:

> Because Map has a lot more methods that weren’t needed and I didn’t want
> to implement?
>
> Ralph
>
> On Aug 20, 2016, at 10:16 AM, Gary Gregory <ga...@gmail.com> wrote:
>
> Hi All:
>
> Now that we have ThreadContextMap2:
>
> Why don't we do ThreadContextMap2 extends Map<String, String>?
>
> Why did ThreadContextMap initially not extends Map<String, String>?
>
> Gary
>
> --
> E-Mail: garydgregory@gmail.com | ggregory@apache.org
> Java Persistence with Hibernate, Second Edition
> <http://www.manning.com/bauer3/>
> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
> Spring Batch in Action <http://www.manning.com/templier/>
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory
>
>
>

Re: ThreadContextMap2

Posted by Ralph Goers <ra...@dslextreme.com>.
Because Map has a lot more methods that weren’t needed and I didn’t want to implement?

Ralph

> On Aug 20, 2016, at 10:16 AM, Gary Gregory <ga...@gmail.com> wrote:
> 
> Hi All:
> 
> Now that we have ThreadContextMap2:
> 
> Why don't we do ThreadContextMap2 extends Map<String, String>?
> 
> Why did ThreadContextMap initially not extends Map<String, String>?
> 
> Gary
> 
> -- 
> E-Mail: garydgregory@gmail.com <ma...@gmail.com> | ggregory@apache.org  <ma...@apache.org>
> Java Persistence with Hibernate, Second Edition <http://www.manning.com/bauer3/>
> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
> Spring Batch in Action <http://www.manning.com/templier/>
> Blog: http://garygregory.wordpress.com <http://garygregory.wordpress.com/> 
> Home: http://garygregory.com/ <http://garygregory.com/>
> Tweet! http://twitter.com/GaryGregory <http://twitter.com/GaryGregory>