Return to Video

Data Relationships - Developing Scalable Apps with Java

  • 0:00 - 0:02
    Let's start off by looking at two important
  • 0:02 - 0:05
    data relationships when you do modeling in data
  • 0:05 - 0:10
    store. They are ancestor relationships and has-a relationships.
  • 0:10 - 0:14
    Starting off with the ancestor relationship in data store
  • 0:14 - 0:16
    it is possible to specify that an entity
  • 0:16 - 0:20
    has an ancestor entity. There are two important
  • 0:20 - 0:23
    rules for ancestor relationships. First of all, it
  • 0:23 - 0:26
    needs to be assigned when the entity is created.
  • 0:27 - 0:30
    And secondly it can never be changed so
  • 0:30 - 0:32
    those are things to think about when you model
  • 0:32 - 0:36
    an ancestor relationship. And given those rules, please note
  • 0:36 - 0:39
    that the ancestor relationship is not the same as
  • 0:39 - 0:43
    the is-a relationship in object oriented modeling. In conference
  • 0:43 - 0:46
    central, we will use the ancestor relationship for the
  • 0:46 - 0:49
    conference kind that you will create shortly. Where the
  • 0:49 - 0:53
    ancestor will be the user who created the conference.
  • 0:53 - 0:56
    Technically speaking though since the users are identified
  • 0:56 - 1:00
    through their profile entities, so in this case the
  • 1:00 - 1:02
    conferences will have the key of the profile
  • 1:02 - 1:06
    entity as their ancestor key. The other relationship we
  • 1:06 - 1:10
    will be using is the has-a relationship. We
  • 1:10 - 1:13
    will be using this relationship to model conferences which
  • 1:13 - 1:16
    users are attending. To do this we will
  • 1:16 - 1:18
    add a property to the profile entity which specifies
  • 1:18 - 1:22
    the attended conferences. So each profile will have
  • 1:22 - 1:25
    a property that contains the conferences that they are
  • 1:25 - 1:29
    attending, observe that this relationship can easily change.
  • 1:29 - 1:32
    We can deregister from conferences and register to new
  • 1:32 - 1:34
    ones, so it is not bounded by the
  • 1:34 - 1:38
    strict rules of the ancestor relationship. So those are
  • 1:38 - 1:40
    the basics of these relationships and that's also
  • 1:40 - 1:42
    enough theory for now. Time to do some coding.
タイトル:
Data Relationships - Developing Scalable Apps with Java
概説:

more » « less
Video Language:
English
Team:
Udacity
プロジェクト:
UD859 - Developing Scalable Apps
Duration:
01:44

English subtitles

改訂 Compare revisions