-
Miltiple interfaces in Java and naming conflicts resolution
Hello,
What are advantages and disadvantages of explicit naming resolution?
If a language supports Multiple Interfaces on single object, it can do so
in a better way than C++. The fact that two methods have the same name still
does not mean they should have the same implementation. – Are these theses
correct?
I find Delphi that is very close in spirit to Java. They both don't tie polymorphism
with inheritance, base their design on interfaces, single root object for
objects and exceptions, support RTTI,... I feel that Delphi has even more
powerful OOP features. IMO Java suffers of lack of covariant return types
and irresolvable naming conflicts. If the first problem seems to be solved
in short time (even more, hostile generics ala templates will be added),
the community prefers not to notice the second problem.
I can bring some examples when lack of this feature enforces to make awkward
bypasses (hacks).
But this feature is a key to make my design perfect.
-
Re: Miltiple interfaces in Java and naming conflicts resolution
"valentin" <valentin@abelectron.com> wrote in message <news:3d72030d$1@10.1.10.29>...
> Hello,
> What are advantages and disadvantages of explicit naming resolution?
> If a language supports Multiple Interfaces on single object, it can do so
> in a better way than C++. The fact that two methods have the same name still
> does not mean they should have the same implementation. – Are these theses
> correct?
In C++ anyway, methods from different interfaces or base classes must
have the same signature, not just the same name, in order to clash.
Visual Basic 5.0 and 6.0 sidestep this problem by not automatically
importing the implemented interfaces into the new class' interface.
> I find Delphi that is very close in spirit to Java. They both don't tie polymorphism
> with inheritance, base their design on interfaces, single root object for
> objects and exceptions, support RTTI,... I feel that Delphi has even more
> powerful OOP features. IMO Java suffers of lack of covariant return types
> and irresolvable naming conflicts. If the first problem seems to be solved
> in short time (even more, hostile generics ala templates will be added),
> the community prefers not to notice the second problem.
>
> I can bring some examples when lack of this feature enforces to make awkward
> bypasses (hacks).
> But this feature is a key to make my design perfect.
URL:http://google.com/search?q=cache:Gko...urn+types&hl=e
n&ie=UTF-8
--
Joe Foster <mailto:jlfoster%40znet.com> "Regged" again? <http://www.xenu.net/>
WARNING: I cannot be held responsible for the above They're coming to
because my cats have apparently learned to type. take me away, ha ha!
-
Re: Miltiple interfaces in Java and naming conflicts resolution
> The fact that two methods have the same name still
>does not mean they should have the same implementation. – Are these theses
>correct?
In the same object they should. If you have a problem in this area then
your design needs changing.
>But this feature is a key to make my design perfect.
No design is ever perfect. Plan to refactor and add functionality.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks