samedi 22 juillet 2017

When using "Table Per Concrete" (TPC) Type, how would corresponding design based on Repository design pattern look like?

I have a "Table Per Concrete" (TPC) Type Database design like in the following picture snapshots UML and ERD diagrams:

(Credit Reference: "Inheritance with EF Code First: Part 3 – Table per Concrete Type (TPC)" http://ift.tt/2eEEzFW ) enter image description here

enter image description here

I am trying to implement code based on the Repository design pattern. However, I'm confused to how I should go about doing it because BillingDetail is an Abstract class, and has Not database table corresponding to it.

How would the UML diagram of the Repositories look like, and what kind of methods would they contain?

In the Business Logic code that gets instances using the Repository entities, wouldn't the following code look Unsophisticated, unrefined and crude:

   if(aBillingDetailInstance is BankAccount)
   {

   } 
   else if (aBillingDetailInstance is CreditCard)
   {


   }

Aucun commentaire:

Enregistrer un commentaire