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
Object is definitely a concrete class, but with the intent to provide all the Java classes with some default functionality like cloning, etc.
Originally posted by Jayadev Pulaparty:
Little correction - Object is definitely an abstract class in Java........ Serious typo. Sorry.
Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
In fact, these Objects make nice semaphores to use for synchronized blocks of code.
Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
Originally posted by Jayadev Pulaparty:
If we are modelling some classes for solving a problem in a particular domain, we tend to look at abstraction w.r.t players (classes) in that domain.
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
I don't agree. When I am designing, I am looking for abstractions that serve the implementation of the solution. I don't care much wether those abstractions also exist in the problem domain.
Well Object is a concrete class so by definition all abstract classes extend a concrete class. Having an abstract class extend another abstract class is also fine.
Originally posted by joshua van-breukelen:
Now Ilja, you had requested a more specific example.
Oh, and Ilja, you never answered my request for a Hefeweizen…
Aber trotzdem, viel Spass,
Joshua
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 Ilja Preuss:
Uh, Hefeweizen? Hilf mir auf die Spr�nge...
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 Don Kiddick:
This is a related question on good style that I have come up against. Is it good style to have an abstract class without any abstract methods ?
The only reason I can think of doing this is to make a class non-instantiable.
In this case you can also (and the choice I normally go for as I think it is bad style to have an abstract class without abstract methods) is to give the class a protected constructor. The drawback with this choice is that the class can be instantiated from within the package.
So neither of these choices seem ideal to me. I realise I'm splitting hairs hairs here but does anyone have anyone have opinions on this ?
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 Don Kiddick:
You learn something new everyday !
Man wird alt wie eine Kuh
und lernt immer noch dazu!
thanks
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 Junilu Lacar:
As has been noted, abstract should be used when the class represents an abstract concept and it doesn't make sense to have instances of it. However, non-instantiability should be a consequence of, not the main factor for, making a class abstract.
Using abstract primarily to prevent instantiation by other classes should be suspect.
consider making constructors private or protected instead.
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 Junilu Lacar:
When you declare a class as abstract, you signify a design intent: normally, that this class provides a "general contract" for use and that subclasses are expected to "enforce" or "adhere to" the contract.
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
World domination requires a hollowed out volcano with good submarine access. Tiny ads are optional.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
|