Design of first distributed architecture

Okay, so I'm trying to design and implement my first distributed project, and I want to make sure my general design is okay before I start. Like I say, I've never used J2EE before, and I'm still learning about it. This is very general.

Problem: Design a login system complete with the following aspects:

- Abasic login window/applet that takes a username and password and verifies them. If they are valid (as determined by specific business logic), return a cookie (assume they are allowed for now) and allow the user access to the requested resources on the server. (Note: I think I'm using the term business logic correctly, but tell me if I'm not.)

- Abasic registration window/applet that takes a user's information. Depending on the business logic, the user will be registered to the database for a certain access level or will become a 損ending user,?which will be reviewed by an administrator before being allowed to access the server抯 resources.

- Anadministrator抯 window/applet that is basically a view of all that goes on in the server. This includes

* current users

* pending users

* audits

* files on the server

* any directory and access protocols

* server settings

Proposal: I plan to follow basic J2EE architecture patterns: The browser will allow access to all of the windows. The windows will call on servlets, which will call on EJBs to access the appropriate tables, all in the same database. I will make a servlet for each table category: UserServlet (for accessing the user list, maybe the list of pending users), AuditServlet, SettingsServlet, LdapServlet, etc.

Should I make a separate servlet and EJB for each category (as listed above)? I still have to read up on EJBs before I implement this.

So that is my basic skeleton, but I have no idea as to its quality. What do you think?

theAmerican

[1958 byte] By [theAmericana] at [2007-10-2 1:02:08]
# 1
An EJB per table seems odd. You should consider some form of ORM. Perhaps EJB3 will work for you. As I understand it, and its beena while since i did j2ee, EJB represents a thing, not a databaase table. i.e. an EJB represents a person, not the person table.
_dnoyeBa at 2007-7-15 18:22:33 > top of Java-index,Other Topics,Patterns & OO Design...
# 2
I would also consider implementing an out-of-the-box controller ala Struts or Spring rather than dozens of Servlets. - Saish
Saisha at 2007-7-15 18:22:33 > top of Java-index,Other Topics,Patterns & OO Design...
# 3

If you are using J2EE I would suggest you read up on the security services provided by your J2EE container. It should provide you with instructions on setting up realms etc and also provide components to access security data in order to perform authentication and authorisation etc.

Unless you have need for extended security you will probably find that the containers services means you wont need to write your own components e.g. LoginEJB that checks usernames and passwords etc.

Hoos

Balavaa at 2007-7-15 18:22:33 > top of Java-index,Other Topics,Patterns & OO Design...
# 4

_dnoyeB said:

> An EJB per table seems odd. You should consider some

> form of ORM. Perhaps EJB3 will work for you. As I

> understand it, and its beena while since i did j2ee,

> EJB represents a thing, not a databaase table. i.e.

> an EJB represents a person, not the person table.

Okay, that makes sense. (The idea of one EJB/table didn't seem exactly right to me.) By ORM, you mean something like Hibernate or EJB3? (Could Spring be involved here? I know it isn't solely concerned with DBs.) I appreciate the advice.

Saish said:

> I would also consider implementing an out-of-the-box controller

> ala Struts or Spring rather than dozens of Servlets.

I was thinking about using Spring. Would you recommend doing that before I even do my first distributed app? Also, which do you prefer: Struts or Spring? Thanks for the input.

Hoos said:

> If you are using J2EE I would suggest you read up on the security services

> provided by your J2EE container. It should provide you with instructions on

> setting up realms etc and also provide components to access security data

> in order to perform authentication and authorisation etc.

> Unless you have need for extended security you will probably find that the

> containers services means you wont need to write your own components e.g.

> LoginEJB that checks usernames and passwords etc.

Awesome. Thanks for the advice. I'll look into it. (This is just kindof an excercise to get my feet wet in distributed programming.) I may consider doing another project instead.

theAmerican

theAmericana at 2007-7-15 18:22:33 > top of Java-index,Other Topics,Patterns & OO Design...
# 5
i had gone through ur problemi think for uspring frame work will suitsby using IOC and AOP in spring frame work u can set instead of writing lot of code
phanidharkumara at 2007-7-15 18:22:33 > top of Java-index,Other Topics,Patterns & OO Design...
# 6
All right, thanks a lot for the advice. I'll look into it.theAmerican
theAmericana at 2007-7-15 18:22:33 > top of Java-index,Other Topics,Patterns & OO Design...