Re: Good Fowler article on ORM
On 05/12/2012 12:53 PM, Jan Burse wrote:
Lew schrieb:
I don't think I get your last paragraph here. What pain? What additional
classes? Why?
The discussion was about some custom HashMap, call this
class XXX. If one does use inline loops such as:
for (int i = 0; i<table.length; i++) {
Entry e = table[i];
while (e!=null) {
/* do something */
}
}
The one does not need to defined an interator for the
custom HashMap, call this iterator class YYY.
If you have a custom 'HashMap', are you extending 'HashMap'?
You would have to avoid that if you are seeking to micromanage the class load.
These iterators which implement the interface Iterator
(or Enumerator) are usually not much visible Java collection
classes, since they are realized as inner classes.
But they add to the LOCs and the number of classes:
With Iterator Without Iterator
XXX N + K LOCs N LOCs
YYY M LOCs
Total N + K + M N
K is for the iterator factories inside the collection
class. Pain = N + K + M - N = K + M.
Since nobody would use class YYY anyway, since XXX
is anyway internal to the whole multi-indexing
framework and not visible by the client of the framework,
its not only a pain but also not a necessity.
I am not convinced that you are discussing real pain.
You seem to be claiming a reduction in class load, which if true might be
useful if it's significant. How much are you saving in class load?
> I'm willing to lay odds that for your use cases
> the difference made by accessors and mutators is
> not the low-hanging fruit.
For gambling you can go to Las Vegas, or if you
are up to something more serious, you could educate
yourself.
Oh, thank you for that, Mr. Snarky One.
Your points don't address mine, however.
You have yet to quote the statistics I requested.
What is the difference in *your* application?
I haven't lost my bet yet.
--
Lew
Honi soit qui mal y pense.
http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg