P
Picho
Hi all,
I popped up this question a while ago, and I thought it was worth checking
again now... (maybe something has changed or something will change).
I read this book about component oriented design (owreilly - Juval Lowy),
and it was actually very nice.
The book goes on about how we should use Interfaces exposure instead of
classes (this is my terminology and english is not my language so I hope you
understand what I'm on about...).
however...
I want to give my classes the ability to staticly create instances, simply
because I think that calling a 'MyClass.FromSomething(Something something)'
is more intuative than a constructor 'public MyClass(Something something)'
this is just me...
anyway, as far as I know interfaces cannot define static members. this
pushed me into something I even like less - a class factory (even though it
is in some scenarios a good practice).
MVP's...
1. Is there a more... 'elegant' way for me to achieve this?
2. is this somehing we want from C# (static member decleration in
interfaces)?
3. am I just being picky (should I just use constructors and forget my
intuition?)
4. am I totaly wrong?
5. all the above
Thanx,
Picho
hang on... can we even define constructors in interfaces today?...
god I even confused myself...
I popped up this question a while ago, and I thought it was worth checking
again now... (maybe something has changed or something will change).
I read this book about component oriented design (owreilly - Juval Lowy),
and it was actually very nice.
The book goes on about how we should use Interfaces exposure instead of
classes (this is my terminology and english is not my language so I hope you
understand what I'm on about...).
however...
I want to give my classes the ability to staticly create instances, simply
because I think that calling a 'MyClass.FromSomething(Something something)'
is more intuative than a constructor 'public MyClass(Something something)'
this is just me...
anyway, as far as I know interfaces cannot define static members. this
pushed me into something I even like less - a class factory (even though it
is in some scenarios a good practice).
MVP's...
1. Is there a more... 'elegant' way for me to achieve this?
2. is this somehing we want from C# (static member decleration in
interfaces)?
3. am I just being picky (should I just use constructors and forget my
intuition?)
4. am I totaly wrong?
5. all the above
Thanx,
Picho
hang on... can we even define constructors in interfaces today?...
god I even confused myself...