I have no problem with converting ER to SQL tables, but I don't know how can I convert EER to SQL tables?
as you Know that EER has "is a" specification and inheritance, but I don't know how relational databases can connect with inheritance specification
...
I have a MustInherit Parent class with two Child classes which Inherit from the Parent.
How can I use (or Cast) Me in a Parent function as the the child type of that instance?
EDIT: My actual goal is to be able to serialize (BinaryFormatter.Serialize(Stream, Object)) either of my child classes. However, "repeating the code" in each ch...
Hello,
I have two classes which both extends Example.
public class ClassA extends Example {
public ClassA() {
super("a", "class");
}
....
}
public class ClassB extends Example {
public ClassB() {
super("b", "class");
}
....
}
public class Example () {
public String get(String x, Strin...
Hi,
I need to create an XML schema definition (XSD) that describes Java objects.
I was wondering how to do this when the objects in question inherit from a common base class with a type parameter.
public abstract class Rule<T> { ... }
public abstract class TimeRule extends Rule<XTime> { ... }
public abstract class LocationRule exten...
It's quite hard to explain what I'm trying to do, I'll try: Imagine a base class A which contains some variables, and a set of classes deriving from A which all implement some method bool test() that operates on the variables inherited from A.
class A {
protected:
int somevar;
// ...
};
class B : public A {
public:
bool ...
By default, a parser generated using ANTLR-3 extends from org.antlr.runtime.Parser. How do I have it extend my custom class instead?
...
I have a parent class which is templated, and a child class which implements it.
template< typename T1, typename T2>
class ParentClass{ . . . };
class ChildClass : public ParentClass<MyT1, MyT2> { . . . };
And I want to have a pointer which I can use polymorphically:
ParentClass<T1, T2>* ptr;
ptr = static_cast<ParentClass<MyT1, MyT2>...
Hi,
I want to create a template class in C#, for example:
public class Foo<T>
where T must inherit from a known class.
I cant seem to find the syntax for that.
Thanks, Malki.
...
hi, i am having issues with my django templating system, i have a base.html file, which contains the content which will be common on all the web pages of the web site, the base.html file fetches some dynamic content, like the categories and the archives, which are passed to it by a python file, which fetches the categories and the archiv...
class A { public: void eat(){ cout<<"A";} };
class B: virtual public A { public: void eat(){ cout<<"B";} };
class C: virtual public A { public: void eat(){ cout<<"C";} };
class D: public B,C { public: void eat(){ cout<<"D";} };
int main(){
A *a = new D();
a->eat();
}
I understand the dia...
In my console application have an abstract Factory class "Listener" which contains code for listening and accepting connections, and spawning client classes. This class is inherited by two more classes (WorldListener, and MasterListener) that contain more protocol specific overrides and functions.
I also have a helper class (ConsoleWra...
I'm relatively new to programming so excuse me if I get some terms wrong (I've learned the concepts, I just haven't actually used most of them).
Trouble: I currently have a class I'll call Bob its parent class is Cody, Cody has method call Foo(). I want Bob to have the Foo() method as well, except with a few extra lines of code. I've at...
What are the consequences of implementing the same interface through two different routes in PHP, are there any?
What I mean, is something like this:
interface baseInterface {}
abstract class baseClass implements baseInterface { }
interface myInterface extends baseInterface {}
class myClass extends baseClass implements myInterface {...
I have a base class like this:
package MyClass;
use vars qw/$ME list of vars/;
use Exporter;
@ISA = qw/Exporter/;
@EXPORT_OK = qw/ many variables & functions/;
%EXPORT_TAGS = (all => \@EXPORT_OK );
sub my_method {
}
sub other_methods etc {
}
--- more code---
I want to subclass MyClass, but only for one method.
package MySubclass...
a.php
#!/usr/bin/php
<?php
class HtmlTable extends DOMElement
{
public function __construct($height, $width)
{
parent::__construct("table");
for ($i = 0; $i < $height; ++$i) {
$row = $this->appendChild(new DOMElement("tr"));
for($j = 0;...
Hi,
Is there any way to delay calling a superclass constructor so you can manipulate the variables first?
Eg.
public class ParentClass
{
private int someVar;
public ParentClass(int someVar)
{
this.someVar = someVar;
}
}
public class ChildClass : ParentClass
{
public ChildClass(int someVar) : base(someVar)
...
Why I have problem creating a class the inherite from str (or also int)
class C(str):
def __init__(self, a, b):
str.__init__(self,a)
self.b = b
C("a", "B")
TypeError: str() takes at most 1 argument (2 given)
tha same happens if I try to use int instead of str, but it works with custom classes. I need to use __new__ inst...
When inheriting a control in Silverlight, how do I find out if its template has already been applied?
I.e., can I reliably get rid of my cumbersome _hasTemplateBeenApplied field?
public class AwesomeControl : Control
{
private bool _hasTemplateBeenApplied = false;
public override void OnApplyTemplate()
{
base.OnApp...
suppose a class has private data members but the setters and getters are in public scope. If you inherit from this class, you can still call those setters and getters -- enabling access to the private data members in the base class. How is this possible since it is mentioned that a derived class cannot inherit private data members
...
Suppose I have
class A { public: void print(){cout<<"A"; }};
class B: public A { public: void print(){cout<<"B"; }};
class C: public A { };
How is inheritance implemented at the memory level?
Does C copy print() code to itself or does it have a pointer to the it that points somewhere in A p...