The Bitter Coder Tutorials VIII: Referencing Instances By Key
Previous posts in the series:
Here’s our class to read a file:
Default contents: This is the contents of file 1 File1 contents: This is the contents of file 1. File2 contents: This is the contents of file 2.
So, as Alex says, the default implementation is the first one in the file, just like using XML.
In his tutorial, Alex gives another example of why you would need to reference implementations by id, so if you’re interested, you can read it there (although, you shoulda already read that post…right?)
Next time, constructor injection…