NB: if you choose to implement your connection class as an inner class, the reference to the factory and thereby the database is created implicitly.Originally posted by Mark Spritzler:
[...]When your client calls getConnection(), the connection object created by the factory is passed a reference to the database instance in the factory. [...]
Peter den Haan | peterdenhaan.com | quantum computing specialist, Objectivity Ltd
It's not important. An inner class gets an implicit reference to the instance of the enveloping class it is associated with. So if a reference to the Data object is, say, stored in an instance variable on ConnectionFactory, and Connection is an inner class, then Connection can directly access the Data object.Originally posted by Mark Spritzler:
Hmm, not sure if I understand what you mean Peter.
Peter den Haan | peterdenhaan.com | quantum computing specialist, Objectivity Ltd
Peter den Haan | peterdenhaan.com | quantum computing specialist, Objectivity Ltd
Peter den Haan | peterdenhaan.com | quantum computing specialist, Objectivity Ltd
Peter den Haan | peterdenhaan.com | quantum computing specialist, Objectivity Ltd
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |