| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: Why can't I have an object with no attributes?
Jan Gelbrich wrote:
>
> Hi, Richard,
>
> just curious:
> why donīt You just use a function for that purpose ?
> That is what stored procedures are for since long ago.
>
> Create or replace function foobar
> return varchar2
> as
> ...
> begin
> ...
> end;
Because, my intention is to build an interface that many other objects could implement. Then polymorphism allows you to use the defined interface with any of the subclasses. It's a fairly essential part of producing reusable object oriented code. I can of course still make the interface but I have to add a useless attribute when I build the object (dummy char(1)). I was hoping someone would have done this before and be able to suggest a better workaround.
Thanks,
Richard
Received on Thu Jun 12 2003 - 13:08:17 CDT
![]() |
![]() |