> Benjamin,
> I don't think my last reply went through.
>

It went through ... I was just too fast in answering :)

>
> You can in effect have your beans be abstract.
>
> Abstract base class bean :
> --------------------------------------------------
> package com.benjamin;
>
> public class ABCBean implements EntityBean {
>
>    // all your base behaviour methods
>
>    // abstract method
>    abstract public Collection getSpecificData();
> }
>
> [snip]
>

This class is abstract because it contains an abstract method (if a class
contains an abstract method, doesn't it have to be declared abstract as
well?) and since my class does not have any abstract methods but instead
should just not be created, this approach would not work for me.

Let me explain my problem a bit more detailed:

1. I've got an Entity Bean which represents an Item in general terms. Since
this is just a general outline of the Item without much useful behaviour to
most of the clients using it, and since it would, if created, insert data
into the database which is rather useless, I don't want the clients to be
able to create instances of an Item. Thus I would like to declare it
abstract.

2. A subclass, eg. Book, would use the existing behaviour in the Item base
class and add the behaviour useful to clients (title, author, isbn, etc.).


But, as the Spec (EJB 1.1) states it (yep, invastigated a little further), I
must not declare the class abstract (see section 9.2.2). So I'm in favour of
the DD approach you outlined. Can you please be a little more precise on how
I would go about it. Would I have to put it in the jar file of its' subclass
and just not mention it in the DD?


Another (but different) question:
Together with this question, another question came up in my mind. Are the
fields of a Primary Key limited to the columns in a database or can I for
example address the name of a table by a field of the Primary Key? Is this
just limited by the tools the Container Vendor provides?


Thanks to all for their help,

.bbr

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to