Architecture :: Creating Each Class Library Project For Interface?
Jan 11, 2010weather to create each class libaray project for Interface, Service, Model, DTO, Repository ?
View 1 Repliesweather to create each class libaray project for Interface, Service, Model, DTO, Repository ?
View 1 RepliesI have a block of SQL statements that I like to use as a sort of function.
I was thinking that I could make a class and inherit all of the master function, then add the parts that I need for other sections of the program in a sub class.
The problem is, up to this point I've been programming ASP .Net through visual studio, and it's kind of just programming behind controls. I'm not sure where to put the class/function/method/interface, or whatever we call it.
Of course you probably know that visual studio creates a bunch of partial classes when you do an ASP. Net application... so.. to get access to a function like object, across classes.. use an Interface?
I'm building an n-tier application, with the web client and the class library separate. I'm also using the factory pattern of development, using interfaces to act as containers for different objects they are associated with. The problem I'm expreriencing is that I declared a public interface class in the class library and I can create an instance of it in in my aspx pages but whenever I declare it in my custom control code-side, i get an error, like so:
Error 20 The type or namespace name 'IContentMaker' could not be found (are you missing a using directive or an assembly reference?)
notge that I have inherited the class library namespace using the 'using' keyword just in case you are wondering. My code is like so:
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using TQO_Classes ; //importing the class library project
public partial class PageContentMgr : System.Web.UI.UserControl
{
private IContentMaker _data; //this line throws the error, it works fine on aspx pages
how to create a class library file and how to implement in web forms?
View 3 RepliesI have a Web project in which I defined some methods to parse some webpages. I then save the retrieved data in a DB. Now I have run a lengthy operation(it may take 2 days) in which I continously parse webpage this way.
Can I use the webproject from a Windows project. If I try to add a refference to it it doesn't work. How should I do it? I have used until now an asp.net application, and done the calls to the parsing methods in the pageLoad event but after an hour or so the process stops.
We are consuming third Web services.
Instead of using datatypes from web service proxy we need to create our own class which will take the values from web service output.
Since the web service data types are so much deep,we are facing lots of problems to create our cutom classes.
Is there any tool available to create classes directly from web services in ordered way....
I am developing a project using Visual Studio 2008 in C#, I have added the class library within the project and set up the relevant references and used the relevant using statements.
this is the error message:
Error 28 The type or namespace name
'Domain' does not exist in the
namespace 'Forestry.SchoolLibrary'
(are you missing an assembly
reference?) C:ProjectsSchoolofForestry runkSourceSchoolAccountPresenterEditAccountPresenter.cs 26 40 School
these are my using statements:
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Data.Linq;
using System.Text;
using System.Xml;
using Forestry.SchoolLibrary.Core.Domain;
using Forestry.SchoolLibrary.Properties;
I'm working on an internet application that has been set up as a web SITE project (I know...) in Visual Studio. I need to add additional features/functionality so have added a class library to the project and referred to it in the main web site project.
The issue now arises because I need to make use of core objects which live inside the App_Code directory in the web site project but this project doesn't appear to expose its DLL like web app/ code library projects do. Because of this I can't add a reference to the web site project in the class library to leverage the common site-wide code/objects.
I can't move the stuff out of App_Code so I'm looking for a way to refer to the website project dll from the new class library.
I have a .net project whose part of the functionality is xls transformation. I now want to move that functionality away from the main project to a separate class library project.
I have no problems moving classes and accessing them, but part of the resources that I wanted to move were xslt files that define the transformations. Those files were originally located in the special asp.net folder: App_Data and then accessed using Server.MapPath(~/App_Data/XSLT/anXsltFile.xslt)
I wanted to move those files to that separate library as well, but not sure how to approach it, and how to access those files within the class library.
I've created class library project and added service reference to webservice. When i try to use webservice object am not able to access webservice methods.
myservice proxy=new myservice();
proxy.( no methods are coming)?
I have a custom gridview control which is a class library project.I want to be able to specify the css class for the gridview which I can do.But I also want to set a default css stylesheet to the gridview. So if I don't override it using the cssclass property it must get it's cssclass from the default stylesheet I have in my project.
How can I specify the default stylesheet. I have a stylesheet in a folder called "Styles" in my project.
I have one C# windows class library type project which has a web reference whose settings are automatically added in to settings.settings file( Webservice name, type, scope, value).
I also have one separate ASP.net project which has let us as suppose, one page with a button. When I click this button, it calls a method of referred DLL of previous project and control goes there.
When in that project, when control goes in to location where I use this web reference, it tries to get the URL of web reference from settings file and raises an exception - 'The current configuration system does not support user-scoped settings'.
So, What is the way for me to call a c# project having web service in a asp.net project ? This is really a source stopper for our development.
I am putting the setting under the property of one of my C# Class Library project for app setting:
EUCAccountService_ConnectionString
EUCTelcoDB_ConnectionString
In the development, it works nicely. Until I deported to production, I realise that the component that use those thing .. it just hang. I found that under BIN when it compiled dewaCorp.EUC.TelcoDB.Data.dll.config and open up that file and turn out nothing.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
</configuration>
How to make this works? I thought by compiling it, it turned to some sort config file or something. But it didn't.
I am implementing a custom membership and role providers where I need to store all the role/membership information in the user's session.
I am implementing these custom providers inside a class library project (different from the website project) and need to access the session in them. The idea is to store the role/membership related information in the session after retrieving them for the first time from the database.
When I try to access the Session using System.Web.HttpContext.Current.Session
I get this as a null object (Object reference not set to an instance of an object.
Why is the session turning out to be null?
Does anyone know what could be the reason I am not able to add reference to System.Web. It gives an exclamation(!) symbol in front of the dll under reference folder in VS 1020. I wand to refer to System.Web.Security.MembershipProvider class.
View 1 RepliesHow to access proxy class of a web service which has been referenced in the website project of a solution within a class library project in the same solution?
I mean no web-service reference/setting is added to the class library and instead it needs to be picked from the web project.
I've got an ASP.NET 4 web forms application I'm building in Studio 2010. The solution has two projects. A web forms application and a class library. I have added a reference to the class libraryr project in the web forms project, but when I go a code behind page in the web forms project, it does not recognize the class from the class library and throws the "type or namespace <class> could not be found ...." error. Adding a using <class library projec> does not work either as it does not recognize that.
What am I missing?
When I make an asp.net web application and add class libraries to the solution, the website project itself has a folder with the same name/contents as the class library.
Eg I make a web application called Test, add a project which is a class library, to the solution, called testAbc, and then there is a folder at the root of the website project called testAbc with the contents of the class lib.
When I make an asp.net web application and add class libraries to the solution, the website project itself has a folder with the same name/contents as the class library.
Eg I make a web application called Test, add a project which is a class library, to the solution, called testAbc, and then there is a folder at the root of the website project called testAbc with the contents of the class lib.
I read why this happens in a book a while ago but can't quite remember now.
Below is my class file.
[Code]....
i have the following code:
[Code]....
I was trying to implement as above. How can i call this class from the code behind of my page, and call the methods Open and Close connection ?
How do i instantiate the object ?
Using Visual Studio 2005
I have list of class files, when i try to run the class files, it showing error as
"a project with output type of class library cannot be started directly"
How to run the class file? How to create a dll file.
I have a table which houses two entities. StaticProgram and DynamicProgram. There is one column in that table called ProgramType which determines if a program is of Type static or Dynamic. Though these two entities are stored in one table (I am guessing because the primitive fields for Static and Dynamic programs are exactly the same) but from a business point of view these are two VERY different entities.
So, I created two Classes StaticProgram and DynamicProgram. However, I donot want to create two seperate Data Access Classes because it is going to be the exact same code replicated twice. I tried creating a "Program" class as base class and inherited StaticProgram and DynamicProgram classes but down casting is not supported so I can't return a "Program" object from the data access class and cast it to "StaticProgram" class.So, what are my options? Can I create an IProgram interface and have StaticProgram and DynamicProgram implement that interface and have my Data Access class return IProgram?
When to use Abstract class and when to use Interface class.
View 10 RepliesI am searching for the advantages and disadvantages of the explicit interface implementation
View 1 Replies