c# - What kinds of types may an interface type include? -
i have class type:
class myclass { … }
i wonder whether or bad design include type of object in interface:
interface iinterface { list<myclass> _myobj { get; set; } }
is bad practice? mean iinterface
depends on myclass
because referencing type?
is bad practice? no. all time.
yes, makes interface "dependent" on type, there no problem that. if need in interface, have chance should dependent.
for me, code fine, wouldn't alter thing except weird naming on property. properties in c# start capital letter, , camel case there (otherwise known pascalcase).
c#
No comments:
Post a Comment