abstract

Non-abstract event defined in abstract class won't show in Designer for derived classes

I'm using the class listed below to create a UserControl wrapping a ComboBox that can accept a List<T> and return an object of type T when the internal ComboBox's selection is changed. Everything works fine in code, exactly as I expect it to, but I can't get SelectedItemChanged event to show up in the Designer anymore when using my con...

Java Generics, extended Generics and abstract classes

I've got the following classes set up: public abstract class Process<T,S> { ... } public abstract class Resource<T, S extends Process<T, S>> { protected S processer; ... } public class ProcessImpl<EventType1, EventType2> { ... } public class ResourceImpl extends Resource<EventType1, ProcessImpl> { processer = new ...

Accessibility of abstract properties

I have an abstract class with an abstract property that is set to have both Get and Set. I know I'll always want to be able to get this property from derived classes but there are some cases where it doesn't make sense to set this property in certain types of derived classes. I can't just omit the Set accessor in a derived class (see c...

Why does PHP 5.2 disallow abstract static class methods?

After enabling strict warnings in PHP 5.2, I saw a load of strict standards warnings from a project that was originally written without strict warnings: Strict Standards: Static function Program::getSelectSQL() should not be abstract in Program.class.inc The function in question belongs to an abstract parent class Program and is de...

C# Const field in abstract class

I'm having trouble declaring a const field in an abstract class. Why is this? edit I should have clarified. My problem is that my child classes can't see the const field: protected const string Prefix = "dynfrm_"; If I remove the const keyword, I can get to it from a grandchild class. ...

Can I create Java-like interfaces in Perl?

I understand that Perl's OO model is rather primitive; it is, in most respects, essentially a namespace hack. Nevertheless, I wonder if it is possible to create something like an "interface?" My goal is to have a base class from which others are extended whose principal purpose is to make mandatory the implementation of certain method...

How can I determine whether a Java class is abstract by reflection

I am interating through classes in a Jar file and wish to find those which are not abstract. I can solve this by instantiating the classes and trapping InstantiationException but that has a performance hit as some classes have heavy startup. I can't find anything obviously like isAbstract() in the Class.java docs. (many thanks for the ra...

Why working with an open ID?

What's the main advantage working with open ID? ...

Interface or abstract class?

For my new Pet-Project I have a question for design, that is decided already, but I want some other opinions on that too. I have a two classes (simplyfied): class MyObject { string name {get;set;} enum relation {get;set;} int value {get;set;} } class MyObjectGroup { string name {get;set;} enum relation {get;set;} int value...

ASP.NET System.Web.Abstractions why were they created as an abstract Base class?

As above really, I'm wondering why Microsoft released the abstractions as abstract classes instead of interfaces? I would be interested in any insights because I need to do something similar for standard things like System.IO features for File and Directory, however I feel that an interface would feel nicer? There must be a good reaso...

Difference between Abstract and Generic code

Hi, What's the difference between the word "Abstract" and "Generic" code in case of Java? Are both mean the same? ...

c# internal abstract class, how to hide usage outside assembly

I have a common assembly/project that has a abstract base class, then several derived classes that I want to make public to other assemblies. I don't want the abstract base class to show up from using code in intellisense so I thought I'd make it internal, I get the error: Inconsistent accessibility: base class 'Settings' is less access...

Using a Windows Form as an abstract class - which pattern to use?

I'm struggling with a situation that I come up again time and time again but I am not sure whether the way that I am doing things is wrong or whether I could be doing things in a different way. An Example: I have a Windows Form that has a DataGridView with some private methods to perform validation of the datagrid and interpreting righ...

Stackoverflow exception thrown from overridden property from abstract base class

Hi all, I have a base class with the following (trimmed for brevity) declaration: public abstract class MyBaseClass { public int RecordId { get; private set; } public string ObjectName { get; set; } public abstract string Status { get; set; } public GetMyObject(int id) { MyObject myObject = context.GetObjectById(id)...

Business delegate handling an exception

Hi, I'm confused in one of the line about Business delegate that says: Business delegate handle & abstract any remote exception What do they mean with the word "abstract" here? Is it just providing a details not how to implement them? ...

Serialization of an abstract class

I'm trying to serialize, and I am facing a problem with an abstact class. I googled for an answer, and I found this blogitem. I tried that and that work. Ok, very nice. But check out the comment on the item: This methodology seems to be hiding the true problem and that is an inaccurate implementation of OO design patterns, na...

Problem with Covariant return types from an abstract method

I’m trying to wrap up a two day beat down on Abstract methods and return type Covariance, I’ve already posted two similar questions and I am eternally grateful to the community for the info provided, I just need one last push to get to the finish line. Here is what I am trying to do: 2 abstract classes, RecruiterBase and CandidateBase, b...

c# Properties in Abstract Base Classes

I have a strange problem that I could not solve. When I try to compile the following snipped I get this error: 'AbstractClass' does not implement interface member 'Property' (Compiler Error CS0535) The online help tells me to make my AbstractClass abstract, which it is. Can anybody tell me where I went wrong? Cheers Rüdiger public in...

How to project Linq results into an Abstract constructor?

Hi All, Yes, this is my fourth day in a row to ask a question about abstracts, sorry, I'll try and go answer some questions about SQLServer to return the favor to the community. Anyway... How can I project the results of a Linq query into a abstract base class collection? Here is my my method from my RecruiterBase abstract class (there ...

Visual / artistic representations of code

I don't know if there is a name for this. What I am interested in is what sort of graphical programs there are for representing code or code development in a high level, abstract and beautiful way. The only example I know of something like this is a video I saw a while ago which used glowing orbs moving around a repository to show user...