So after learning a little bit about programming to interface and some other inheritance related topic I have another question.
Databases are usually parent child tables. Many application have 2-4 levels for heirarchy, like referral, referralitem, referralbillingitem etc and some lookup tables. Now if I model this as classes I will have
Class Referral
{
List<ReferralLineItems> rli;
}
Class ReferrralLineItem
{
List<ReferralBillingLineItem> rbli;
}
Where can I apply Interface or abstract class in this case?
Thanks!
I have seen many senior architects creating Interface for IReferralBLC, and IReferralLineItemBLC etc to encapsulate business logic. These interfaces almost always have only one implementation like ReferralBLC, ReferralItemBLC etc, so why is interface needed?