Skip to content

Conversation

@ctrueden
Copy link
Member

This branch moves the OMEXMLMetadataImpl#resolveReferences method into the OMEXMLMetadata interface proper. Once the interface itself declares the method, the various explicit casts to OMEXMLMetadataImpl are no longer needed, and interface-driven design works to keep the codebase extensible.

The resolveReferences method belongs in the OMEXMLMetadata interface,
rather than as a public method of its implementation.

Once the interface itself declares the method, the various explicit
casts to OMEXMLMetadataImpl are no longer needed, and interface-driven
design works to keep the codebase extensible.
@jburel
Copy link
Member

jburel commented Nov 22, 2012

@rleigh-dundee: any comment after Today's review of the PR?

@ghost
Copy link

ghost commented Nov 22, 2012

Hmm, I commented on this already. Must have gone onto a different PR or maybe didn't press the comment button.

I'm not an expert with this part of the code. But the patch looks fine, builds fine, and showinf produces valid OMEXML, so I can't see anything which precludes merging.

Couldn't run "ant test" because it was broken on develop today.

@ctrueden
Copy link
Member Author

This is a very straightforward change. When you use an interface-driven design, all public methods should be declared in the interface, not the implementing class. Otherwise, to use the method, you are forced into dangerous casts which prevent third-party extensibility.

The only possible danger I see is if there is some other implementation of OMEXMLMetadata in our codebase (perhaps in OMERO?) which would stop compiling with this change in force. To fix that easily, simply have the alternative implementation implement the new iface method but throw UnsupportedOperationException (or actually implement the method, if it's easy).

@melissalinkert
Copy link
Member

There are no other implementations of OMEXMLMetadata, so that's all fine.

melissalinkert added a commit that referenced this pull request Nov 27, 2012
@melissalinkert melissalinkert merged commit 7549495 into ome:develop Nov 27, 2012
@ghost ghost mentioned this pull request Apr 23, 2013
hflynn pushed a commit to hflynn/bioformats that referenced this pull request Oct 11, 2013
Update Ice on Windows paragraph
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants