.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Abstract Class

Posted By:      Posted Date: October 24, 2010    Points: 0   Category :ASP.Net

what is the function of abstract class, why design pattern need to build BLL and DAL

anyone give an example for my reference as I am getting strat to build my web-based  project 

View Complete Post

More Related Resource Links

abstract away the source of the connection string using a class with a static property.

ASP.NET provides a configuration system we can use to keep our applications flexible at runtime. In this article we will examine some tips and best practices for using the configuration system for the best results.

The element of a web.config file is a place to store connection strings, server names, file paths, and other miscellaneous settings needed by an application to perform work. The items inside appSettings are items that need to be configurable depending upon the environment, for instance, any database connection strings will change as you move your application from a testing and staging server into production.

Let's abstract away the source of the connection string using a class with a static property.

Singleton Pattern and Abstract Class


I know what Singleton Pattern means and Abstract class means.

What I wanted to know was how would this apply to real world.

Could anyone give me any good example or simple explanation.

Say I have a simple website, why would I use any of the above if any.

Why would it simplify my architechture.

Thanks in advace. 

Abstract class properties work when not implemented?

Hi, I was just looking at a code example and was confused by the behavior of classes implementing an abstract class. So the project has an abstract class named GeneralItem with some abstract properties. Another class named NspItem inherits GeneralItem. NspItem does not implement any of the abstract properties from GeneralItem yet I can write code that successfully sets those properties. How is that working? Is the compiler automatically creating them for me? Example: public abstract class GeneralItem { public string Description { get; set; } } public class NspItem : GeneralItem { public NspItem() { } } static class Program { [STAThread] static void Main() { NspItem item = new NspItem(); item.Description = "Some String"; Console.WriteLine(item.Description); } } //Output would be: Some String

when abstract class and when interface

hi...need a practical scenario where interface can be used and where abstract class and also the need for constructors and destructors practically?? theoritically i know the differences ..but during coming to the implementation how to decide??...like why do u declare a class as abstract... thanks in advance 

Use UserControl, where the base class is an abstract one.




When I inherits my usercontrol from an abstract class, I got the warning message on design time.

How can I overcome this warning message?

The designer must create an instance of type but it cannot because the type XYZ is declared as abstract.


Thanks :)

Abstract class


In my engineering i never understand abstract class

but now after enter in developing field i go through various kind of RND work

Please solve my problem about abstract  class 

My code below

in my connection class i declare one more class name is shape


public abstract class Shape
    public abstract void Test(int x, int y)
public abstract class Shape1 : Shape
public class Shape2 : Shape1

what is the difference between abstract class and interface

hi,recently i went for an interview they ask me what is abstract class ,interface and its difference
I said abstract class contain abstact method ,abstract method is a method with no body.Abstract class cannot be instantiated.Abstract class is a base class it required derived class for the implementation of method.
Interface is a syntactical contract that all derived class should follow 
it define properties ,method,events which are known as member of interface.
Then They asked me what is the difference between them. I said 
abstract class interface 
1.abstact class can implement method 1.interface cant
2.abstact class can contain constructor, 2.interface cant
3.abstract class cannot support multiple 3.interface support
Then they said some different answer I said dont no.
Then they ask me when i should make abstract class for an project and when 
i should make interface.
I said if suppose there is two class which must be having method with different logic then we sholud make abstract class. 
and if suppose we have two class having method .with different logic then we can make interface .
Am i correct with my explainatio

Abstract Factory Design in C# , Vb.NET

Provide an interface for creating families of related or dependent objects without specifying their concrete classes

Class Diagrams

Class diagrams show the static structure of the systems. Classes define the properties of the objects which belong to them. These include:

Attributes - (second container) the data properties of the classes including type, default value and constraints.

Creating a Simple Class in C#

The second article in the C# Object-Oriented Programming tutorial describes how classes are created in C# and how behaviour, in the form of publicly visible and private, hidden methods can be added. This demonstrates some of the uses of encapsulation

Static Class for Beginners

In general, the members of a class can be accessed by instance of that class when they are in public, but there comes a situation to access or call members of a class without an instance and this can be achieved by declaring them as static

Abstract Factory Design Pattern (Sample in C# and VB .NET)

An abstract factory provides an interface for creating families of related objects without specifying their concrete classes. Sometimes one wants to construct an instance of one of a suite of classes, deciding between the classes at the time of instantiation. In order to avoid duplicating the decision making everywhere an instance is created, we need a mechanism for creating instances of related classes without necessarily knowing which will be instantiated.

Abstract Factory Pattern-Creational Patterns

The Factory pattern allowed us to decouple our client from an object which it uses. The Abstract Factory pattern extends this idea to manage separate families of objects.

A runtime selection, or configuration option, in our client could decide which family of objects is to be used. The Abstract Factory pattern allows us to write generic code to instantiate and use the family objects regardless of which family is chosen at runtime. The pattern also helps us enforce a rule where objects from just the chosen family are used uniformly by the client.

InterFaces and Abstract Classes

Link Describes About Abstraction and Interfaces In Breif

MSDN Abstract Classes Link

MSDN Reference For Abstract Clases

MessageQueue Class

This sample demonstrates two way communications using message queuing between a device application and a desktop application. One application sends book order messages to a message queue and another application receives these book orders from the message queue and responds to the device queue that the orders have been processed.

How to change the default page base class?


I've tried setting the <pages pageBaseType="DynamicWebPage" /> value in web.config, but when I response.write out the page type, I'm still getting Microsoft.WebPages.WebPage.

I'm simply trying to sub-class WebPage and add some additional functionality such as a dynamic PageData dictionary similar to Phil Haack's dynamic ViewData dictionary.



ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend