Hi there. I'm trying my best to figure out a succinct, straightforward widget, using standard UI widgets available in any toolkit (e.g., checkboxes, radio buttons, or listboxes), that could model a true/false/null value.
Why am I trying to do this? I'm storing a tree in a database (go ahead, criticise me for storing hierarchical informa...
I have a container of smart pointers to mutable objects. I have to write two *for_each* loops, one for accessing the objects as read-only data and another for mutable data. The compiler is telling me that std::vector< boost::shared_ptr<Object> > is not the same as std::vector< boost::shared_ptr<const Object> >, note the const.
Here ...
AFAIK inheritance in Perl is usually set up like this:
package Mule;
our @ISA = ("Horse", "Donkey");
Are there any examples where use base (or use parent) is better instead?
...
Hi,
I'm trying to write a software in JavaScript, but I'm having hard time trying to get the idea of all this prototype and other wicked looking inheritance stuff.
What I would like to know are the different ways to get inheritance, and the pros and cons of each.
...
I've ran into a problem recently while developing with Spring Security. It has an interface GrantedAuthority with following signature:
public interface GrantedAuthority extends Serializable, Comparable
And as for Java 1.5 and later, the interface Comparable takes a type parameter T, which is omitted in Spring Security libraries (obvio...
Here's an example using multiple interface inheritance in Java and there's an issue.
Note that I fully know why there's an issue and this is not the point of my question. The question is about how you name this particular multiple interface inheritance ambiguity, if there's a name for it.
For example, in C++, the ambiguity that arises...
Hi all,
So I'm learning Javascript and all its' prototype goodness, and I am stumped over the following:
Say I have this
var Animal = function (a, b, c, d, e, f, g, h, i, j, k , l, m, n){
this.a = a;
this.b = b;
//...etc...
};
var x = new Animal(1,2,3....);
Now how do I create a Cat constructor function that inherits from ...
I want to attempt an MVC design for my little app.
I have a normal Csharp class ViewBase which extends UserControl. It's a single .cs file.
I have multiple classes that I want to extend ViewBase. These are actual UserControls so they have a code behind .cs file and a .xaml file.
However, CSharp tells me that for these classes, their b...
I have the following class with static properties and methods which helps manage users on a website. I want to be able to re-use this class among other projects by overriding some properties.
public class Account {
public static string sessionName = "Account";
public static string tableName = "Accounts";
public static boo...
Hey everyone,
I whould like to creat a serialization mechanism, to work on a variety of entities, all of which are based
on a few base-classes.
Now I want to work with DataContractSerializer, so I need to mark all my classes with [DataContract].
but I dont want to do that because that is a big room for error for other members of my tea...
I am trying to create a custom datasource control.
I have been following this article to the letter (I think...).
I have a skeleton / basic implementation of my datasource, however when I declare it in the markup and try to statically bind it to a gridview, I receive the following error:
The DataSourceID of 'grdVw' must be the ID o...
I've got an interface inheritance issue that has been vexing me for some time. It doesn't seem to make any sense, and I can only conclude that I'm missing something fundamental.
Overview
The code below is from part of a fluent interface for our ORM tool. It provides a SQL-like syntax for pulling data from the database. You don't have t...
Using EF 4.0 Code only i want to make an assocation between an abstract and normal class.
I have class 'Item', 'ContentBase' and 'Test'.
'ContentBase' is abstract and 'Test' derives from it.
'ContentBase' has a property 'Item' that links to an instance of 'Item'.
So that 'Test.Item' or any class that derives from 'ContentBase' has an...
Hello,
I have 3 classes and I run the first class and declare a variable in the second class and want the 3rd class to be able to print out this variable. I have code below to explain this more clearly.
from class2 import Class2
class Class1(Class2):
def __init__(self):
self.value1 = 10
self.value2 = 20
def a...
Hi Guys
with reference to c# inheriting generic collection and serialization… question
If you are providing a paged collection it is useful to pass back the total available so the client can set up they paging control. Does anyone know a nice way to achieve?
Also why is this "By Design" seems pointless.
Cheers.
...
This question seems weird, but i came across this question in one of the interviews recently.
I ve been asked, is there a way in c# to hide the methods partially in a inherited child classes?. Assume the base class A, exposed 4 methods. Class B implements A and it will only have the access to first 2 methods and Class C implements A wi...
I'm trying to use a User model inheritance in my django application. Model looks like this:
from django.contrib.auth.models import User, UserManager
class MyUser(User):
ICQ = models.CharField(max_length=9)
objects = UserManager()
and authentication backend looks like this:
import sys
from django.db import models
from django...
I have my domain model with several NewsType's which are subclasses of NewsItem as shown below (simplified):
public abstract class NewsItem : Entity
{
public virtual Account Account { get; set; }
public virtual DateTime DateTime { get; set; }
}
Here are a couple of subclasses of NewsItem:
public class NewsItemJoiner : NewsIte...
I have the following classes
class A{
private String name;
private int value;
public A(String n, int v){
name = n;
value = v;
}
public void print(){
System.out.println(name + " " + value);
}
}
class B exten...
Consider a sports club situation.
A club can have a Club manager and 1 or more Coaches (1 coach per team)
So, here is an example of the Manager and Coach classes.
Class ClubManager
{
public void RegisterMember()
{
// code for registering a member..
}
}
Class Coach
{
public void DeviceTeamFormation()
{
...