Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

C Db Helper Ods INSTANCE Db Helper C getInstance( get connection Q close Db Help

ID: 3810022 • Letter: C

Question

C Db Helper Ods INSTANCE Db Helper C getInstance( get connection Q close Db Helper est O helper Db Helper nit Helper C Q close Helper 0 G connection Test void C Contact Of address phone Numbe Contact (string, string, strin getName 0 Basic Data Source M setName (String Db Peer getAddress set Address (String Db Helper m get phoneNumber( Connection set Phone Number (String setlDlint) void equals (Object Om hashCode to String0 get IDO oad (int) delete Contact Test Contact helper close Helper( save DataTest tex Contact DbHelpen String String String String String String boolean nt String Contact tex main (Stringa) process Data File (Strinnoid

Explanation / Answer

In here there are mainly 2 classes namely Contact and DbHelper and two test classes for these classes and an main class
here the yellow symbols represent the object and the m representd the methods that would be called. here the symbol <----- represents the weak relationship that is not id dependent,which means that an entity is existence independent of other entity.Here all the relation are one to one relations, the diamond shape at the end of the solid line between DbHelper and DbHelperTest means the relation is Composition that is one class is built as a result of the collection of the other class , here parent class is one where the diamond shape is present and the other class would be child class, the composition relation means that once the parent class is destroyed the child class will also be obliterated.The right hand keywords repersents the return type of the methods.

DbHelper is an inbulit class which would exttend the TestCase class , this consists of the different method which colud be overrided based on your requirements.

The init() and close() function are used to initialize and close the classes for example of init()
/**
      * Test of init method, of class DBHelper.
       */
      public void testInit() throws CeleritasException {
          System.out.println("init");
          boolean expResult = true;
          boolean result = DBHelper.init();
          assertEquals(expResult, result);
      }


The DbHelperTest class is user to run the DbHelper class, similarly is the ContactsTest class for Contacts.