Design Help

  • Thread starter Thread starter John Doe
  • Start date Start date
J

John Doe

I have created a NSlookup class which can query a DNS for any type of record
(20 different ones). However I am having problems understanding how I
should return a value/record after querying\. Because you can request any
one of 20 different records I need to be able to return the type of record
you requested.

Current setup is a nslookup class which has properties for setting query
type with a function called execute which builds and executes the query
against the DNS. Once the query comes back it is parsed out, and depending
on record type is moved to whatever class and returned. I know I can do 20+
functions and try to accommodate every possible return type but is that
really necessary? Is there another way around this? Since this is all
happening in the same function I would rather not have 20+ possible events
that could be returned either.

Can anyone shed any light?
 
could you create 20 classes that derive from one base class?

return the base type then check what it was by 1) using if type is, or 2)
have a property that holds the type?

Steve
 
Back
Top