I am developing a forum (discussion) site and other funny stuff. First, I will explain:
(Note: this question goes not about ASP.NET or .NET, but about OOP in general).
Most of the things run on a database. I created a database class that simplifies the interacting between the other code and de database provider. Other classes must inherit this class. This code is in a separate .NET DLL.
Other classes that derived from the core class are classes for discussion algorithms, user login…etc…
These classes are used by the ASPX files (or if you are unknown with .NET, let’s call it PHP files if you want). The ASPX files have also an own code base. Because I am using many controls, it is very hard to put this code into the DLL; I have to send references of all the controls to that particular DLL.
Okay my question is revealing.
I wrote that classes in the DLL inherit form the kernel. They search the database and process the tree algorithms and so on. They also give the output in HTML format or give the controls the correct values. However, there is also similar code in the ASPX files that should be in the DLL. I wrote this in the ASPX files because of the references to the ASP.NET controls (more then 12 controls).
The real question is how I can put this thoroughly in good layers, without writing much code to do this. The classes in the DLL (also the functions in the ASP.NET file) use the kernel class for processing things. Have I to partition the things?
? Do I have to write one layer that has only access to the database and the kernel class and another class that formats the output and have to do with the controls? Nowadays one class does this. E.G., the discussion class inherits form the database class, has access to the database, and formats the output.
Could you give me advice? When you do not understand me, I will explain it later. When you can give me also some advice on programming in ASP.NET, I’m pleased.
I am developing a forum (discussion) site and other funny stuff. First, I will explain:
(Note: this question goes not about ASP.NET or .NET, but about OOP in general).
Most of the things run on a database. I created a database class that simplifies the interacting between the other code and de database provider. Other classes must inherit this class. This code is in a separate .NET DLL.
Other classes that derived from the core class are classes for discussion algorithms, user login…etc…
These classes are used by the ASPX files (or if you are unknown with .NET, let’s call it PHP files if you want). The ASPX files have also an own code base. Because I am using many controls, it is very hard to put this code into the DLL; I have to send references of all the controls to that particular DLL.
Okay my question is revealing.
I wrote that classes in the DLL inherit form the kernel. They search the database and process the tree algorithms and so on. They also give the output in HTML format or give the controls the correct values. However, there is also similar code in the ASPX files that should be in the DLL. I wrote this in the ASPX files because of the references to the ASP.NET controls (more then 12 controls).
The real question is how I can put this thoroughly in good layers, without writing much code to do this. The classes in the DLL (also the functions in the ASP.NET file) use the kernel class for processing things. Have I to partition the things?
? Do I have to write one layer that has only access to the database and the kernel class and another class that formats the output and have to do with the controls? Nowadays one class does this. E.G., the discussion class inherits form the database class, has access to the database, and formats the output.
Could you give me advice? When you do not understand me, I will explain it later. When you can give me also some advice on programming in ASP.NET, I’m pleased.
(Note: this question goes not about ASP.NET or .NET, but about OOP in general).
Most of the things run on a database. I created a database class that simplifies the interacting between the other code and de database provider. Other classes must inherit this class. This code is in a separate .NET DLL.
Other classes that derived from the core class are classes for discussion algorithms, user login…etc…
These classes are used by the ASPX files (or if you are unknown with .NET, let’s call it PHP files if you want). The ASPX files have also an own code base. Because I am using many controls, it is very hard to put this code into the DLL; I have to send references of all the controls to that particular DLL.
Okay my question is revealing.
I wrote that classes in the DLL inherit form the kernel. They search the database and process the tree algorithms and so on. They also give the output in HTML format or give the controls the correct values. However, there is also similar code in the ASPX files that should be in the DLL. I wrote this in the ASPX files because of the references to the ASP.NET controls (more then 12 controls).
The real question is how I can put this thoroughly in good layers, without writing much code to do this. The classes in the DLL (also the functions in the ASP.NET file) use the kernel class for processing things. Have I to partition the things?
? Do I have to write one layer that has only access to the database and the kernel class and another class that formats the output and have to do with the controls? Nowadays one class does this. E.G., the discussion class inherits form the database class, has access to the database, and formats the output.
Could you give me advice? When you do not understand me, I will explain it later. When you can give me also some advice on programming in ASP.NET, I’m pleased.
I am developing a forum (discussion) site and other funny stuff. First, I will explain:
(Note: this question goes not about ASP.NET or .NET, but about OOP in general).
Most of the things run on a database. I created a database class that simplifies the interacting between the other code and de database provider. Other classes must inherit this class. This code is in a separate .NET DLL.
Other classes that derived from the core class are classes for discussion algorithms, user login…etc…
These classes are used by the ASPX files (or if you are unknown with .NET, let’s call it PHP files if you want). The ASPX files have also an own code base. Because I am using many controls, it is very hard to put this code into the DLL; I have to send references of all the controls to that particular DLL.
Okay my question is revealing.
I wrote that classes in the DLL inherit form the kernel. They search the database and process the tree algorithms and so on. They also give the output in HTML format or give the controls the correct values. However, there is also similar code in the ASPX files that should be in the DLL. I wrote this in the ASPX files because of the references to the ASP.NET controls (more then 12 controls).
The real question is how I can put this thoroughly in good layers, without writing much code to do this. The classes in the DLL (also the functions in the ASP.NET file) use the kernel class for processing things. Have I to partition the things?
? Do I have to write one layer that has only access to the database and the kernel class and another class that formats the output and have to do with the controls? Nowadays one class does this. E.G., the discussion class inherits form the database class, has access to the database, and formats the output.
Could you give me advice? When you do not understand me, I will explain it later. When you can give me also some advice on programming in ASP.NET, I’m pleased.