Wiki

Clone wiki

Java EE 6-Galleria / DataModel

The Logical Data Model

The Logical Data Model of the Application

The data model is quite simple for now.

Users are associated with Groups. Many users can be associated with a group, and there may be multiple groups. For now, there is only one group, for registered users.

Groups are associated with a unique groupId.

A User is identified by a user-specified userId that is unique among users, and is associated with a password, to enable the user to sign in to the application.

Users can have many Albums, with each Album containing Photos. Each Album can have a cover Photo; an album with no photos will have no cover photo. When a User is deleted, the Albums owned by the user are deleted. When an Album is deleted, the Photos in the album are also deleted.

When an Album is created, a name and an optional description must be supplied. These are provided by users to organize albums.

Albums will be identified by a unique number - the albumId which is an incrementing sequence that will be provided by the application. Album names could be the same across multiple users - we do not want users to be unable to choose a name for their album because another user had chosen the same!

When a Photo is uploaded, the application is expected to store

  • a title for the photo
  • a short description of the photo in the description attribute,
  • the file name of the uploaded photo in the fileName attribute,
  • the binary contents of the photo in the file attribute,
  • the time of the upload in the uploadTime attribute.

Photos will be identified by a unique number - the photoId which is an incrementing sequence that will be provided by the application. The title and description attributes are used to enable users to organize photos - photos could lack a title at the time of creation, making them unsuitable as primary key candidates. Also, titles of photos could be the same across multiple users - we do not want users to be unable to choose a title because another user had chosen the same for a differnt photo! The file, fileName and uploadTime attributes for a Photo cannot be null, since a photo is expected to be associated with a binary file that was uploaded at some point in time.

The Physical Data Model

The Physical Data Model of the Application

Updated