Originally posted by Warren Dew:
whether static functions are easier to reuse
[OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Originally posted by Warren Dew:
Java's single inheritance limitation would prevent tests from using both the database code and the file system code. Such tests did exist.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Originally posted by Warren Dew:
Can you expand on what you mean in light of that?[/QB]
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Originally posted by Mark Lybarger:
i think there is value in doing end to end black box type of testing like this. tests where you need the database, you need the remote application, you need the filesystem.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Originally posted by Jeanne Boyarsky:
No!!! They are impossible to mock, extend, etc. This makes them harder, if not impossible, to test in addition to being harder to reuse.
Originally posted by Gerald Davis:
What kind of destination does Object Oriented Technology have between these two categories? In my experience most OOP geeks mix code from both categories together so making feature reuse hard because it is mixed up with context specific data.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Originally posted by Gerald Davis:
Sum up
1.Instance methods can only be used by data in class.
2.Static methods can be used by any data.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
The sin of unnatural grouping
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Originally posted by Gerald Davis:
OOP
nmbr = Str.find(�occurence�)
nmbr = list.find(�occurence�)
OOP
As you can see, the Object Oriented example has two different find methods one for string and one for list. Does those find() methods share any common functionality? It�s hard to know because they are in two different places.
Procedurally
The Procedural example uses one method find() to handle both. The chances are that the find() function can share common functionality between String and List.
The OO methods can do that, too, of course, they'd just do it differently (probably in a more decoupled way).
The more objects and types use this find() function the better.
Why? As far as I can tell, it would just couples those types to the find function - and the more you do that, the more monolitic the system becomes. *Unless* you apply some techniques to abstract away from the concrete types inside the function - for example by using polymorphic method calls on them.
OOP
If you Object Oriented geeks wanted to be flash, I guess that you would create a Find Class Interface then maybe use an Abstract Classes to share any commonality.
I'd more likely use delegation than inheritance for this.
The sin of unnatural grouping is a crime that many if not most OOP geeks do without knowing. Grouping functionality by action (Find(), Split(), UpperCase() Length()) is better then grouping by Class Type.
The former might be true, in which case I'd say that they need to be educated. I don't buy the latter, though. It certainly depends on how you design your classes, doesn't it?
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Originally posted by Gerald Davis:
Grouping functionality by action (Find(), Split(), UpperCase() Length()) is better then grouping by Class Type.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Originally posted by Gerald Davis:
I wanna go home
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
So I left, I came home, and I ate some pie. And then I read this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
|