I think preserving binary compatibility on its own is a strong reason for doing 
this, but it's more than that. 

Having a separate factory for flow messages makes both factories more cohesive 
(single responsibility principle). No need for one factory to extend the other 
in my view.  

The logger would have separate instances so users can configure them 
separately: lower coupling. 

These are both desirable properties so I believe it would improve the design. 

Does this make sense?
Remko

Sent from my iPhone

> On 2016/02/19, at 2:24, Gary Gregory <[email protected]> wrote:
> 
> Is a flow message factory a kind of message factory or a different kind of 
> factory?
> 
> Does a logger need instances of both or just the one?
> 
> Since entry message extends message, should the factory do so as well?
> 
> Gary, phone, typos.
> 
>> On Feb 18, 2016 8:44 AM, "Remko Popma" <[email protected]> wrote:
>> Would anyone mind terribly if I factored out the FlowMessage creation 
>> methods from MessageFactory to a new interface FlowMessageFactory?
>> 
>> Concretely, this interface would contain the methods introduced in 
>> LOG4J2-1255:
>> EntryMessage newEntryMessage(Message message);
>> ExitMessage newExitMessage(Object object, Message message);
>> ExitMessage newExitMessage(EntryMessage message);
>> ExitMessage newExitMessage(Object object, EntryMessage message);
>> I think flow messages are different enough from normal Messages that a 
>> separate factory makes sense. 
>> It would also insulate users who created a custom MessageFactory from the 
>> changes we made in LOG4J2-1255. 
>> Thoughts? 
>> -Remko

Reply via email to