[ 
https://issues.apache.org/jira/browse/ANY23-398?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hans Brende updated ANY23-398:
------------------------------
    Description: 
The {{BenchmarkTripleHandler}}, {{ExtractionContextBlocker}}, 
{{IgnoreAccidentalRDFa}}, {{IgnoreTitlesOfEmptyDocuments}}, 
{{LoggingTripleHandler}}, and {{ReportingTripleHandler}} classes could all 
potentially be subclasses of {{CompositeTripleHandler}} to reduce delegation 
boilerplate.

In addition, we could add the following constructor to 
{{CompositeTripleHandler}} for ease of subclassing by classes with a single 
delegate:

{code}
public CompositeTripleHandler(TripleHandler delegate) {
    this(Collections.singleton(delegate));
}
{code}

-Also, we should make CompositeTripleHandler extend FormatWriter (which extends 
TripleHandler) for more versatility.-     Actually, no. Since 
CompositeTripleHandler might delegate output to *multiple* FormatWriters, any 
future methods that we might add to FormatWriter interface (e.g., 
{{FormatWriterFactory getFormatWriterFactory()}} ) might become nonsensical 
when composed together by a CompositeTripleHandler.

  was:
The {{BenchmarkTripleHandler}}, {{ExtractionContextBlocker}}, 
{{IgnoreAccidentalRDFa}}, {{IgnoreTitlesOfEmptyDocuments}}, 
{{LoggingTripleHandler}}, and {{ReportingTripleHandler}} classes could all 
potentially be subclasses of {{CompositeTripleHandler}} to reduce delegation 
boilerplate.

In addition, we could add the following constructor to 
{{CompositeTripleHandler}} for ease of subclassing by classes with a single 
delegate:

{code}
public CompositeTripleHandler(TripleHandler delegate) {
    this(Collections.singleton(delegate));
}
{code}

Also, we should make CompositeTripleHandler extend FormatWriter (which extends 
TripleHandler) for more versatility.


> Make use of CompositeTripleHandler
> ----------------------------------
>
>                 Key: ANY23-398
>                 URL: https://issues.apache.org/jira/browse/ANY23-398
>             Project: Apache Any23
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 2.3
>            Reporter: Hans Brende
>            Priority: Minor
>             Fix For: 2.3
>
>
> The {{BenchmarkTripleHandler}}, {{ExtractionContextBlocker}}, 
> {{IgnoreAccidentalRDFa}}, {{IgnoreTitlesOfEmptyDocuments}}, 
> {{LoggingTripleHandler}}, and {{ReportingTripleHandler}} classes could all 
> potentially be subclasses of {{CompositeTripleHandler}} to reduce delegation 
> boilerplate.
> In addition, we could add the following constructor to 
> {{CompositeTripleHandler}} for ease of subclassing by classes with a single 
> delegate:
> {code}
> public CompositeTripleHandler(TripleHandler delegate) {
>     this(Collections.singleton(delegate));
> }
> {code}
> -Also, we should make CompositeTripleHandler extend FormatWriter (which 
> extends TripleHandler) for more versatility.-     Actually, no. Since 
> CompositeTripleHandler might delegate output to *multiple* FormatWriters, any 
> future methods that we might add to FormatWriter interface (e.g., 
> {{FormatWriterFactory getFormatWriterFactory()}} ) might become nonsensical 
> when composed together by a CompositeTripleHandler.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to