locked
Business Object for Lookup (common) Taable RRS feed

  • Question

  • hi all,

      I am desiging business objects (entities )for my applicaation. I haave confusions in Look up table. Generally lookup tables includes collection of different categories of data

    Eg: Designaion, Country etc..

    How can i design busniess enitity for this. If i generate one entity as Lookup how can i differentiate betwwen designation and country ? If i create seperate entity for courty and and Designation every time new category is addded to lookup table i need to create seperate enity ?

    Can anyone guid me a better approach for this scenario?

    Tuesday, March 27, 2012 3:08 AM

Answers

  • Are the properties of all the look up entities the same? So will Designation and Country have the same properties or completely different properties or some properties that are common?

    Depending on what your answer is to the above question, consider using Generics. FOr example have a class called LookUp<T> where T is the individual look up entity. All the common code can go into LookUp class. Depending on how organized you want to make you can add LookUp<T> where T: ILookup.

    Hope this helps,

    Technocrat_aspire

    • Marked as answer by akhilrajau Thursday, April 12, 2012 1:10 AM
    Wednesday, April 4, 2012 9:25 PM

All replies

  • Are the properties of all the look up entities the same? So will Designation and Country have the same properties or completely different properties or some properties that are common?

    Depending on what your answer is to the above question, consider using Generics. FOr example have a class called LookUp<T> where T is the individual look up entity. All the common code can go into LookUp class. Depending on how organized you want to make you can add LookUp<T> where T: ILookup.

    Hope this helps,

    Technocrat_aspire

    • Marked as answer by akhilrajau Thursday, April 12, 2012 1:10 AM
    Wednesday, April 4, 2012 9:25 PM
  • Thanks mate Like you told i got that idea from the following thread

    http://forums.asp.net/t/1273449.aspx/1

    Anyway we need to create seperate entity objects for all lookup record types and create generic claass in DAL to avoid duplicate coding. Am i right?

    How i treat the same in business? Same genric concept or indepenedent methods as these needs to be visible indepenedely in service layer?

    Thursday, April 5, 2012 7:25 AM
  • i am going with generic class anyway separate entities are needed for each item
    Thursday, April 12, 2012 1:11 AM