Hi! I started to play around with jboss, read the doc's about CMP,BMP and wrote some test-beans to understand the examples. i think that i'm familar with the basic concepts of jboss. i think that's the time to start writing an application. i've got a web based address-manager which ist coded in .php and the db is postgres running under debian/linux. i want to port this application to j2ee and work with jboss and its features... but i've got some design problems where you can help. i look for a smart way to access my "business logic" by web (=jsp and servlets) and over a remote interface by e.g. a swing application. i want to start with a simple 1:N relation:
+----------------+ +----------------+ +-------------+
| person | | phone | | phone_type |
+----------------+ +----------------+ +-------------+
| id (pk) | <-+ | id (pk) | +-> | id |
| firstname | +- | person | | | descr |
| lastname | | type | -+ +-------------+
+----------------+ | number |
| priority
| remarks |
+----------------+
you see a table "person" which contains the single field for a person
like its name. but a person can have multiple phone numbers with
different priorities and types which are predefined in an extra
table (e.g. "fax","mobile","at work","private").
as i've read, it isn't possible to keep the object relation over remote
interfaces. in some examples with remote access there is a session-bean
which manages the related object.
ok, i'll write a "ManagerBean" which implements methods like
void addPerson(Integer id, String firtname, String lastname)
Person[] findByName(String name)
Person findByPrimaryKey(Integer id)
Sting getPersonFirstName(Integer id);
Sting getPersonLastName(Integer id);
int getPersonPhoneEntriesCount(); //
void addPersonPhone(Person p, Interger id, String number, ...)
String[] getPersonPhoneNumber()
String[] getPhoneTypes();
...
but i can't belive that i have to implement _all_ of the possible access
methods to implement a full featured address management. there should be
a much better way to make the above work!?
Perhaps you could show me an example implementation which works with a
similar design problem. the clou is, that i want to have one layer to
access the address-management. it would be nice, if it could be extented
to work with SOAP/WDSL.
i was not able to find corresponding docs/examples. please help a poor
but willing beginner :)
thanx a lot
markus
msg21748/pgp00000.pgp
Description: PGP signature
