Well, a hierarchy has has node that are parents and children.

Our docs say:

/**
 *  Markers are objects that are used to add easily filterable information
to log messages.
 *
 *  Markers can be hierarchical - each Marker may have a parent. This
allows for broad categories
 *  being subdivided into more specific categories. An example might be a
Marker named "Error" with
 *  children named "SystemError" and "ApplicationError".
 */


But if I can make this easy mistake:

Marker err = MarkerManager.getMarker("Error");
arker serr = MarkerManager.getMarker("SysError");
Marker aerr = MarkerManager.getMarker("AppError");
err.add(serr);
err.add(aerr);

Instead I have to do:

serr.add(err);
aerr.add(err);

If the API tells me the relationship, if I have to write backwards code,
then I can see it is backward ;)

// no addChild API
serr.addParent(err);
aerr.addParent(err);

And of course forget the obvious:

err.addChildren(serr, aerr)

so addParents(Marker...) would be OK too.

Gary




On Thu, May 1, 2014 at 10:07 AM, Ralph Goers <[email protected]> wrote:

> Well, Bruce wants that method to accept a variable number of Markers, so a
> name that is singular would be awkward.  What else would one be adding?
>
> It seems like we spend more time discussing renames than anything else -
> like actually picking a logo.
>
> Ralph
>
> On May 1, 2014, at 6:57 AM, Gary Gregory <[email protected]> wrote:
>
> I find the API name Marker.add(Marker) unclear.
>
> OTOH, Marker.setParents(Marker...) is clear.
>
> I propose to rename add(Marker) to addParent(Marker).
>
> And I do not want to think about addChild(Marker) ;)
>
> Gary
>
> --
> E-Mail: [email protected] | [email protected]
> 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: [email protected] | [email protected]
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

Reply via email to