need suggestion for the code
-
Project 1 I have four classes class1 this contains the variables, properties and constructors suppose
private string abc;
Interface2 This contains interfaces
void a1();
class3 this will have function definitions. basically this will contains functions to do the database interactions
public void a1()
{
// code.....
}class4 this will inherit Interface 2 and will override the definition.
public void a1()
{
class3 a = new class3();
a.a1();
}Project 2 class5 this will have function
public static Interface2 Getclass4_Details()
{
return new class4();
}Project 3 In the form button click i am doing
Interface2 Obj = null;
Obj = project2.class5.Getclass4_Details();
obj.a1();I am approaching in the above way to do database interaction. Am I approaching i the right direction ?
-
Project 1 I have four classes class1 this contains the variables, properties and constructors suppose
private string abc;
Interface2 This contains interfaces
void a1();
class3 this will have function definitions. basically this will contains functions to do the database interactions
public void a1()
{
// code.....
}class4 this will inherit Interface 2 and will override the definition.
public void a1()
{
class3 a = new class3();
a.a1();
}Project 2 class5 this will have function
public static Interface2 Getclass4_Details()
{
return new class4();
}Project 3 In the form button click i am doing
Interface2 Obj = null;
Obj = project2.class5.Getclass4_Details();
obj.a1();I am approaching in the above way to do database interaction. Am I approaching i the right direction ?
abcurl wrote:
Am I approaching i the right direction ?
I suspect not, but it is difficult to understand what you are trying to achieve. The only thing I would say is that this looks extremely complicated; are you sure you need so many classes and interfaces?
MVP 2010 - are they mad?
-
abcurl wrote:
Am I approaching i the right direction ?
I suspect not, but it is difficult to understand what you are trying to achieve. The only thing I would say is that this looks extremely complicated; are you sure you need so many classes and interfaces?
MVP 2010 - are they mad?
-
Project 1 I have four classes class1 this contains the variables, properties and constructors suppose
private string abc;
Interface2 This contains interfaces
void a1();
class3 this will have function definitions. basically this will contains functions to do the database interactions
public void a1()
{
// code.....
}class4 this will inherit Interface 2 and will override the definition.
public void a1()
{
class3 a = new class3();
a.a1();
}Project 2 class5 this will have function
public static Interface2 Getclass4_Details()
{
return new class4();
}Project 3 In the form button click i am doing
Interface2 Obj = null;
Obj = project2.class5.Getclass4_Details();
obj.a1();I am approaching in the above way to do database interaction. Am I approaching i the right direction ?
It's not immediately clear to me why you need class4 as well as class3. What value do you gain by having class4 in there instead of having class3 implement interface 2? Class 4 seems to do nothing but bucket-pass calls straight on to class 3. By the way, better names might make the example a bit easier to understand.
-
It's not immediately clear to me why you need class4 as well as class3. What value do you gain by having class4 in there instead of having class3 implement interface 2? Class 4 seems to do nothing but bucket-pass calls straight on to class 3. By the way, better names might make the example a bit easier to understand.
-
Reason - I am implementing the multiple inheritence concept in class4 by overriding the function