[ 
https://issues.apache.org/jira/browse/SOLR-3044?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13188549#comment-13188549
 ] 

Jason Rutherglen commented on SOLR-3044:
----------------------------------------

+1 NamedList is an oldie, not not a goodie.
                
> Incrementally deprecate NamedList & replace with typesafe API
> -------------------------------------------------------------
>
>                 Key: SOLR-3044
>                 URL: https://issues.apache.org/jira/browse/SOLR-3044
>             Project: Solr
>          Issue Type: Improvement
>    Affects Versions: 3.6, 4.0
>            Reporter: Simon Willnauer
>            Priority: Critical
>
> The first thing I can think of when I see how and where NamedList is used in 
> solr is "if you have a hammer in your hands, every problem looks like a 
> nail". IMO and I know others think the same way the use of NamedList is way 
> over the top for a long time. However the biggest issues here is the massive 
> use of this class all over the place which has several problem, here is a 
> list just to name a some:
> * no type safety
> * produces lots of garbage
> * makes things hard to refactor
> * binds everything strongly to Solr and is contra modularization 
> * code is hardly readable - one example is all the distributed request / 
> response processing
> * requires autoboxing of primitives all over the place
> * some processing is N^2 where N is possible 
> * requires tons of instanceof conditions
> * ...
> Yet this task is not simple nor is it possible to do this in a single patch. 
> I think the target of this issue and all its subtasks will be 5.0 but we need 
> to start doing it to eventually clean up the API enough to get rid of all the 
> issues I named above.
> One way of starting would be to create a couple of subtasks like:
> * Refactor ResponseWriters to pass in a StreamWriter similar to what XML or 
> JSON apis (Jackson / STAX) and let the ResponseObject write itself based on 
> the StreamWriter impl.
> * Refactor configuration and resourceloading to use some libraries that are 
> specialized to do that.
> * Deprecate SearchComponent methods that accept named list in favor of a 
> typesafe API
> I think we should start doing this its time to move on here!

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to