I'm drawing some UML in which a concrete class inherits from an abstract class which defines a pure virtual method. Is it required to show this method in the concrete class as well? It's implied by inheriting from the abstract class.
...
Hi,
I am trying to formalize my programming practices in preparation to do it professionally (I have been doing it as a hobby for 18 years). Unfortunately they didn’t really teach us useful stuff in school, so I am trying to learn these things on my own. One aspect that I am trying to learn is unit-testing.
I have read various things a...
To cut a long story short I have a C# function that performs a task on a given Type that is passed in as an Object instance. All works fine when a class instance is passed in. However, when the object is declared as an interface I'd really like to find the concrete class and perform the action upon that class type.
Here is the ubiquitou...
I've an already existing database and want to access it using SQLAlchemy. Because, the database structure's managed by another piece of code (Django ORM, actually) and I don't want to repeat myself, describing every table structure, I'm using autoload introspection. I'm stuck with a simple concrete table inheritance.
Payment ...
I have an interface ITransaction as follows:
public interface ITransaction {
DateTime EntryTime { get; }
DateTime ExitTime { get; }
}
and I have a derived class PaymentTransaction as follows:
public class PaymentTransaction : ITransaction {
public virtual DateTime LastPaymentTime
{
get {...
I have a default concrete type defined in a registry:
ForRequestedType<IXRepository>()
.TheDefaultIsConcreteType<CacheXRepository>();
The ChaceXRepository has the following constructor:
public class CacheXRepository: IXRepository{
public CacheXRepository(IXRepository xRepository,ICache cacheService){
In the constru...
I'm thinking about designing a method that would return an object that implements an interface but whose concrete type won't be know until run-time. For example suppose:
ICar
Ford implements ICar
Bmw implements ICar
Toyota implements ICar
public ICar GetCarByPerson(int personId)
We don't know what car we will get back until runtime....
Is there a way in C++ to construct your class such that given a pointer to your class you can instruct dynamic_cast<>() how to cast to another class for which you are wrapping the implementation? Would operator cast do the trick? Imagine I have an Abstract interface base class and derive a concreteA from this as well as concreteB, but ...
The end goal for this post is to override the ToString() method of a concrete implementation of a generic base class while still being able to search the implementation using Linq flattening technique. So if you read this and see a better way let me know. I'm using Telerik controls for Silverlight and they won't change their api to allow...
Hi, why cannot I declare an abstract method within an interface? This is my code. Thank you.
<?php
interface Connection {
public abstract function connect();
public function getConnection();
}
abstract class ConnectionAbstract implements Connection() {
private $connection;
public abstract function connect();
publi...