Adam

A few answers from my side, well knowing that I might be wrong:
> 
>  1) I am frankly pissed that CitedReferences/CitingArticles/etc is not 
> documented in the code or the online help, if the comment is still correct. 
> This accounts for a huge amount of boilerplate-looking code, which in my 
> experience is a disaster for testing after rewriting/refactoring. I suggest 
> removing them in your rewrite.

Since these parts do not seem to be user-accessible anyway, I agree. I however 
leave the final decision to you guys.
> 
>  2) BDSKISISourceXMLTagPriorityKey is apparently an array of fields. No idea 
> what the hell it does, as it's not documented in the code or on the wiki. I 
> suggest removing it in your rewrite.

Same as above.
> 
>  3) Style: is testing isKindOfClass: really the only way to distinguish the 
> body parts? It's generally frowned on in Obj-C.

Can you make an example to me as a non Obj-C programmer so that I can test the 
correct way?

> 
>  4) Style: as far as I know, the remainder of BibDesk does not use the Obj-C 
> dot syntax for accessors, but it looks like that was used in the previous 
> iteration of this class. Personally, I detest it and would prefer square 
> brackets, but this isn't your fault.

That I can change very easily, use brackets instead of dot-syntax. I have, as 
you say, followed the syntax of the original code since I learned it this way.
> 
>  5) Style: downloadWithSearchTerm:database:options: is >300 lines, and 
> createPublicationInfoWithRecord() is >460 lines. This is really unfortunate, 
> as they are both unmaintainably long.

I agree.
> 
>  6) There's a hardcoded date of "2020-01-01" in there. This needs to be 
> +[NSDate distantFuture] or +[NSDate date]. 2020 is only 6 years away, and 
> I've been contributing code to BibDesk for the past 12 years :-).

I have not checked that part of the code, but I can change that. Thanks for the 
hint.

> 
> 
> The chief points are really the last two. Can Xpath queries be used to avoid 
> walking the tree(s) so many times? The multiple nested while() loops make me 
> really nervous from a readability standpoint.

Ok, here's the answer from a novice Obj-C programmer: 
I've tried the Xpath syntax since it was also used in the original code. It 
failed for WOKSearch V3 since sub-tree identifiers are not unique wihtin the 
whole tree (e.g. the identifier "names" appears several times in the tree, 
naming several different sub-tree key's, such as author names, publication 
names, title names etc.). Searching for XPath:name resulted in a wild match of 
totally different things. I've avoided this by walking through individual 
sub-trees, one by one.

Now my question: can the XPath query be used to match these subtrees uniquely 
("XPath:names" matches both)?
a) summary->names
b) summary->publishers->publisher->names

If it is possible, I'll replace the complex walk through sub-trees with single 
XPath statements.

Reto
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Bibdesk-develop mailing list
Bibdesk-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-develop

Reply via email to