Write a discussion response on Melinda.
Write a discussion response on Melinda.
May 4, 2020 Comments Off on Write a discussion response on Melinda. Uncategorized Assignment-helpObject-relational mapping can be used to address the IMP. The IMPs that I will focus on are inheritance and relationships.Object-oriented languages such as Java support inheritance. Inheritance is when a subclass inherences properties and behaviors from a superclass. The IMP occurs with inheritance since relational databases do not have inheritances. One way to address this problem using object-relational mapping is to map a class’ attributes to one table using the root class as the name of the table (Ambler, Mapping Objects to Relational Databases: O/R Mapping in Detail, n.d.). The PK would then be a persistent object identifier (POID), which can be donated as POID with being the name of the root class (Ambler, Mapping Objects to Relational Databases: O/R Mapping in Detail, n.d.). For example, if you have a superclass of Pet with subclasses Cat and Dog the name of the table is Pet and the PK is PetPOID. The table would then also have class types and the attributes of the classes (Ambler, Mapping Objects to Relational Databases: O/R Mapping in Detail, n.d.). For example, PetType is either be Dog or Cat and some attributes are Name, Food, Color, and Size.When dealing with relationships one area where there is an IMP is that relational models only have bi-directional relationships, while object models can have unidirectional or bi-directional relationships (Ambler, Mapping Objects to Relational Databases: O/R Mapping in Detail, n.d.). When mapping relationships it is good practice to keep multiplicity the same, for example, one-to-one relationships should stay one-to-one (Ambler, Mapping Objects to Relational Databases: O/R Mapping in Detail, n.d.). The IMP of the relational model not supporting uni-directional relationships can be handled with foreign keys. For example, if you have an Employee class with a unidirectional relationship with their Position you can indicate the relationship direction by having a PositionID PK in the Position table and the PositionID FK in the Employee table (Ambler, Mapping objects to relational databases, 2000). For a bi-directional relationship, there would need to be a FK called Employee in the Position table too (Ambler, Mapping objects to relational databases, 2000).