Note that there are some explanatory texts on larger screens.

plurals
  1. PODesign of account e-mail activation (with Hibernate in mind)
    text
    copied!<p>I have a design problem which I would like some input on. Here are the constraints:</p> <ol> <li>Each user must have a working e-mail address when registering their account. When registering their user account an activation email should be sent, containing a link with an activation code which must be followed for the account to be activated.</li> <li>Each user account exists in exactly one office which exists in exactly one company.</li> <li>The first registered user from a company creates the company and one office. The rest of the company users are then invited by the first user.</li> <li>The companies may interact with each other, but only if the companies first users are activated (i.e. they clicked their respective activation links after registering).</li> </ol> <p>Here is a small UML-diagram of how it could be solved:</p> <p><a href="http://i43.tinypic.com/2dj5bhh.png" rel="nofollow noreferrer">alt text http://i43.tinypic.com/2dj5bhh.png</a></p> <p>In the above diagram some details are left out. The diagram shows classes and fields only. When it comes to fields they're just used conceptually to show which information should be stored, please ignore their scope.</p> <p>Some thoughts and questions:</p> <ul> <li>User and NotActivatedUser are mostly the same. Should they be one single class or separated? If they are separated, which form of Hibernate inheritance persistence would you use?</li> <li>If an account isn't activated after a certain time it should be removed. If it was the first user, which also created the users Company and Office both of these should be removed too. Do we need NotActivatedOffice and NotActivatedCompany as well? (For clean separation in the database.)</li> </ul> <p>How would you design this kind of solution? Do you feel keeping non active and active entities separate in the database is important? Why or why not?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload