Override The Methods + Role Of Abstraction And Encapsulation?

Jan 4, 2011

1. Why we need override the methods? (i know what is ovwrriding but why ?)I gave answer to extend the functionality of method is it right ? again sub question was ,

Class A
{
method1()[code]....

if i can create the object of Class A in class B and can invok the method then why need to override metho here ? in fact i could not get this question , because i think both concept are irrelevat with each other. why he asked this ?same for overloading.

why we need overloading?If MSIL is there then what is need of CLS(common language runtime ) and CTS(common type system)List the 5 resposibilities of CLR (I explained only CTS,CLS,Garbage collection) was i right . what else?

What is role of abstraction and encapsulation? what the difference between them ? In which situation we have to devlop abstration and encapsulation.


6.What is included in signatures , when we said overloading means same name but different in signature. Is access modifiers included?

7.What is asp.net application life cycle?

8.Let say I am requesting for web application first time (genuine first time), how the request will executes? how IIS will know that for which application is this request is ?

9.If interfaces have empty methods (implicit abstract method) then what is its need? why we say it is reduces the code and provide reusability ?

10.In which scenario we need to implement interfaces?

11.In which circumstances we need to develop abstract classes?

12.Is class is static, means we can not create its instance, we can not derive it then how can we use method containing it? Why we need static classes?
Please guide me about these all question

13 What are the http handlers. http modules? who handle the request and resposes? why need of httpcontext ? what are the limitations of http handler, httprequest, httpcontext, httpresponse.

View 4 Replies


Similar Messages:

C# - Abstraction And Encapsulation In Asp.net?

Mar 13, 2010

when we write all our application methods and variables in a classes is nothing but data abstraction and encapsulation.Is it right?

View 2 Replies

Architecture :: Differentiate B.w Abstraction And Encapsulation?

Feb 14, 2011

I cannot differentiate b.w Abstraction and Encapsulation.Could anyone explain diff b/w these two together with some c# examples?

View 9 Replies

Security :: Override The XmlSiteMapProvider And Add An Attribute Indicating Which Role Provider To Use?

Jan 27, 2011

I was hoping some of you would entertain my XmlSiteMapProvider question. I have a portal site that has multiple ASP.NET Role Providers. One for each child web application. I need to basically change the role provider on the fly. Does anyone know if this is possible? My approach is to maybe override the XmlSiteMapProvider and add an attribute indicating which Role Provider to use. Then, in the
IsAccessibleToUser method, I was planning on dynamically change the role provider some how based off the new attribute.

Again, is this approach seem reasonable/doable or am I in the weeds here? I'm open to alternatives if anyone has one.

View 1 Replies

Security :: Role Class Methods Not Being Detected?

Feb 5, 2010

I'm trying to create roles for my web application using the Role class methods provided in ASP.net but when I attempt to use the class methods as such:

[Code]....

View 5 Replies

C# - Hierarchal Data Context And Abstraction?

Mar 31, 2011

I am creating a core library for one of our internal project. This core library supposed to contain some abstract classes and generic classes which will then be extended by specialized projects. For example, There is an AbstractPerson class with standard properties and methods for a Person class while another project will implement a Person class which will inherit from the AbstractPerson class to add project specific functionality.

Now we need to impelment DAL for this common and specialized projects.As most of operations are generic so i want to include them into core library as Repository classes. However, Repository classes need to access LINQ dataContext. Which is generated from the specialized databases. Hence there is no dataContext available in Core library to work. So how could i can create a common repository classes for generic methods which can reside in the common library.

View 1 Replies

C# - Class Encapsulation With Repository Pattern?

Oct 18, 2010

I am sort of using a repository pattern to extract information from a database. I have two classes, report and reportRepository.

The trouble I have is that since reportReposity has to fill in all the details for the report object, all the members in the report have to be publicly accessible.

Is there a way so that I can ensure that only the repository class can access some of the methods of the report class and only it can set some of the properties that other classes cannot, sort of like what friend does in c++. Or is there a completely different way of handling this situation?

I am using C# in ASP.NET 2.0

View 2 Replies

Architecture :: Encapsulation Doubt In The Code?

Nov 26, 2010

I am using code like this in Business Logic.Can u explian the below whether i am using Encapsulation concept in the below code.Also tell me why i should use private for declaring variable _Region and public for the property Region


private string _Region;

public string Region
{ [code]....

View 5 Replies

Security :: How To Create Custom Role Information Instead Of Using Built-in Role Database

Nov 13, 2010

Usually in sub-folder we will limit the access right to some roles and this feature requires pre-defined database schema.

However, if i still want to use this role feature of asp.net, but I do not like the pre-define database schema, I want to extract role information from my own database table and bind it to the role.

View 2 Replies

Using Extension Methods In Static Methods On Extended Classes?

Aug 16, 2010

I have an extension method as follows:

public static class PageExtensions
{
public static int GetUserId(this Page targetPage)
{
var user = Membership.GetUser(targetPage.User.Identity.Name);
return (int)user.ProviderUserKey;
}
}

Now in a page I need to use this method in a static WebMethod, so I have added another 'extension method' to PageExtensions:

public static int GetUserId()
{
return (int)Membership.GetUser(HttpContext.Current.User.Identity.Name).ProviderUserKey;
}

and I call it as follows in my WebMethod: PageExtensions.GetUserId()

View 1 Replies

Web Forms :: How To Change This Methods In To Use Dictionary Or Extension Methods

Jul 23, 2010

public class CacheHelper { /// <summary> /// Removes object with the specified key. /// </summary> /// <param name="key">The key.</param> [code]....

I have this methods for caching..I need to change this methods to use in aDictionary<string,object>

How do I need to change this code Because I am new to asp.net I am still learning..

View 12 Replies

Security :: Sql Role Provider Does Not Allow To Update The Role Name?

Mar 18, 2011

Why asp.net sql role provider does not allow to update the role name , whats its reasons.

View 5 Replies

C# - Can Set A Role Description When Adding A New Role

Nov 3, 2010

When adding a role (making use of asp.net's role provider), i cannot find a method to add a role including a description.the asp.net Role table in SQL makes provision for a role description, however the only method available is:Roles.CreateRole(string RoleName);here is no overload to include a description.Is there an out of the box way of including the description? or should i go about this myself?

View 1 Replies

Security :: Not Extending MembershipProvider Class And Putting All This Methods In Some Unique Class And Call Its Methods Then?

Sep 16, 2010

I am beginner in web applications development. I started one little project and host it on source forge "https://homoco.svn.sourceforge.net/svnroot/homoco". And I started implementing authentication in this application to learn how it works. From my experience people never use out of the box things so I want to implement this stuff alone (like in real world projects). So some questions:

1) Is there any reason to use membership out of the box? To use database table schema, stored procedures etc. that tool generate for developer. I think that this lower control over code and I decided to implement it my self. I don't know if I am right.

2) Is my approach in this demo project good or bad (if someone have time I like to do just a little code review)? I created database based on business rules. Not using database schema that membership provider require. Extend "MembershipProvider" class to satisfy my needs. Implement queries to database myself.

3) Now, this question is a little wired but I have to ask it. If we make custom Membership Provider and do sql queries alone, implement all MembershipProvider class methods ourselves, and in application use Membership.blabla() why is this approach different from not extending MembershipProvider class and putting all this methods in some unique class and call its methods then? I hope that someone understand what I ask here.

I am sorry for three questions, but I really trying to find the best way to implement this feature in my demo project like it is a real world application.

View 3 Replies

Security :: Get The Role Id Rather Than The Role Name?

Feb 10, 2010

How can i get the role id, rather than the role name?

For instance with the code below

Dim roles1 As String() = Roles.GetAllRoles()
GridView1.DataSource = roles1
GridView1.DataBind()

I can access the role name in the gridview like below, but how could I get the ID to pass in a hyperlink?

<asp:Label ID="lbl1" runat="server" Text='<%#Container.DataItem.ToString() %>' Visible="false" />

View 1 Replies

C# - Is It Possible To Override ResolveUrl

Dec 14, 2010

I use the following my .net applications to resolve the path to an image or css file or javascript file.

<%=ResolveUrl("~/Scripts/myscript.js")%>

<%=ResolveUrl("~/images/myimage.jpg")%>

All my pages and controls inherit from a base page or base user control.

I have tried but didnt succeed in overriding the ResolveUrl method so that I could include some custom logic in the files path.

how I might override the ResolveUrl method? Alternative is to create my own custom method that does similar but would prefer to work with ResolveUrl.

View 2 Replies

MVC :: Can Call The Methods Inside The Controller And Inside The Models "Action Methods"

Mar 21, 2011

i have a repository class inside my model folder; this repositiry contains many methods , which are called from Action methods in the controllers; so my question is :- if i have a method insidle my model.reporsitory which calls a stored procedure, then can i call it an "action method"? or "action method" expression only apply to controller methods?

View 4 Replies

MVC :: Override HtmlHelper.LabelFor?

Jul 1, 2010

I am using VS2010 & MVC2 to develop a web app. I noticed that HtmlHelper.LabelFor doesnt contain an override that accepts either a css class or html attributes. I was thinking about writing my own override for this, but am struggling with it.

The current LabelFor method accepts a lambda expression and automatically extrapolates the property name, display name (if specified via [DisplayName] attribute and value and generates the label. How do I write my overridden to do the same, but also insert any htmlAttributes specified such as class, style etc.

View 5 Replies

MVC :: Override Default Validations

Mar 1, 2011

i cant seem to selectively disable serverside validation using annotations. Data annotations and unobtrusive validation is an awesome feature and has worked out great for us thus far but trying to localize it has been fruitless.

Basicly i have a property in a model object like this (it wraps a DTO)

[Code...]

i can change the output text for things like data range, required, string length etc. but simple stuff like "this field has to be a number" seems hidden away.

View 5 Replies

User Sessions Override Each Other

Oct 21, 2014

I have a Asp.net web application that is running on 4.51 , When the User login Successfully i return an Object that has info for that user and store this in a Static object. Now my problem is the i

User 1 Login (Welcome James)

and

User 2 Login (WelCome Daniel)

and User 1 refreshes the Page (Welcome Daniel)

My user sessions override each other. i did mess around with the IIS Session before , i just noticed this now.

View 1 Replies

Trying To Override The UniqueID Attribute Of An HtmlInputRadioButton

May 13, 2010

I'm trying to override the UniqueID attribute of an HtmlInputRadioButton. I'm extending the HtmlInputRadioButton class and using the code below:

[Code]....

But the rendered radio button tag looks like this:

[code]....

View 1 Replies

C# - How To Override Wsdl Generation In Web Services .Net

Aug 4, 2010

I would like to create a WebService in .Net who expose multiple WebMethods

I need a WebService version per new implementation (WebMethod or New Property in Business Object), like this :

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class Service : System.Web.Services.WebService
{
[WebMethod]
[WebServiceVersion("1.0")]
public string HelloWorld()
{
return "Hello World";
}
[WebMethod]
[WebServiceVersion("1.1")]
public string NewMethodInVersion1_1()
{
return "Hello World";
}
}

With UrlRewriting or HttpHandler :

HelloWorld WebMethod only : http://localhost/Service/1.0/Service.asmx

HelloWorld WebMethod and NewMethodInVersion1_1 : http://localhost/Service/1.1/Service.asmx

How can i generate a wsdl dynamically for the specific version used by the customer ?

View 3 Replies

Security :: How To Override Membership.GetUser()

Sep 22, 2010

i have add a new column (CustomeAuth) to aspnet_Users but i need to get the value of this column just like:

Membership.GetUser().UserName

so i can use :

Membership.GetUser().CustomeAuth

View 3 Replies

C# - Get Compile Error With Method Override

Nov 29, 2010

I have a ProductService class that defines the following methods. It doesn't work, as I will explain further below, but it gives the compile error CS1061: 'ProductService' does not contain a definition for 'GetByid'. Unless I've dropped the ball on method overloading, why is the public overload of GetById not seen by other code?

public IEnumerable<Product> ListActiveByCatId(Guid catId) {
return _entityContext.Products
.Include("Category")
.Where(p => p.Category.id == catId);
}
[code]....

View 4 Replies

MVC :: No Suitable Method Found To Override

Nov 12, 2010

I'm going through this tutorial [URL]

[Code]....

When I compile, this error message comes up: 'Framework.ImportControllerFactory.CreateController(System.Web.Routing.RequestContext, string)': no suitable method found to override I have navigated to the definition in the DefaultControllerFactory, and it's (snipping the comments):

[Code]....

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved