Update Edited to reflect clarifications requested by Chris Holmes below. Originally I was referring to a Terminal as a Site but changed it to better reflect my actual domain.
At heart, I think this is a question about modeling a many to many relationship between two root entities where the relationship itself carries some semantic mean...
My first post so please go easy on me!
I know that there's no real difference between structs and classes in C++, but a lot of people including me use a struct or class to show intent - structs for grouping "plain old data" and classes for encapsulated data that has meaningful operations.
Now, that's fine but at what point do you start...
I'm looking for a pattern for this general case:
"I need to get a subset of data based on directly related criteria and indirectly related data."
...
I have different classes called English, Spanish, French, etc.:
Class English{
String name = "English";
String alias = "ENG";
}
Class French{
String name = "French";
String alias = "Fre";
}
Similarly other language classes.
And one more class called Language:
Class Language{
String name = "";
String alias = ...
For example, do you use accessors and mutators within your method definitions or just access the data directly? Sometimes, all the time or when in Rome?
...
I'm trying to subclass the wxpython SingleChoiceDialog class. I have a TableChoiceDialog class that inherits from SingleChoiceDialog adding generic functionality, and I have 2 sub classes for that add more refined functionality. Basically I'm O.O.P'ing
In my TableChoiceDialog class I have a line which calls the superclass's __init__, ...
Unlike protected inheritance, C++ private inheritance found its way into mainstream C++ development. However, I still haven't found a good use for it.
When do you guys use it?
...
I've never used it in the professional software even though in our shop, and others I have worked for, we design large scale systems. The only time I messed with virtual inheritance was during my interview in a company. Nonetheless, I played with it during afterhours.
Do you guys use it? Do you understand how it works in depth (how mo...
Can someone please explain "re-usable structures" for me?
I was working on making some db objects in php, but was told I was using too much processing from the computer cause I made stuff to complicated with the below objects:
My DB objects:
$db = new Database;
$db->db_connect();
$post_content = new DbSelect;
$post_content->select('id...
It seems there is a new catch-phrase emerging in the web development field: object-oriented CSS.
On the face of it, this strikes me as simply being best-practice packaged up in a catchy slogan. I understand and fully respect the intentions behind the movement, but is there any more to it?
Does anyone have any further insight that sets...
In my app, I am creating a series of validation classes to check, for example, that a user entered Name property of the class (from a WinForm) doesn't exceed the size of the varchar() in the database.
Currently, the validation code will throw a custom Exception if the Name field is too large. (The custom exception, when caught by the UI...
Let's say I have a simple class called WebsterDictionary that has a function that can take a word and return its definition. Perhaps there is another function that can take a definition and return a word. The class is used all the time by many clients.
To facilitate the lookups, the class contains a member variable that is an in-memo...
In my experience in object oriented C programming I have seen two ways to implement derived classes.
First Method, have a definition of the parent class as a .h file. Then each class that derives from this class will have do:
File parent_class.h:
int member1;
int member2;
File testing.c:
struct parent_class {
#include "parent...
I'm beginning to learn Ruby on Rails, and looking at other peoples code. Is there any way to take an exisiting codebase and create object relationship diagrams or Entity relationship diagrams (ERD's) ?
I know Visio can do some things given a database, but I was hoping to produce diagrams of classes, objects and objects.
...
I have a class Request.cs
It has an abstract method:
public abstract Response CreateResponse(XmlReader reader);
and there's also a method:
public Response SendRequest(string requestURI)
{
...
XmlReader reader = XmlReader.Create(responseStream);
return CreateResponse(reader);
}
The CreateResponse method is implemented...
I'm writing a flex program in an OO manner and I've got to the point of creating a ViewStack to hold various panels. My problem is that when I add a panel to the ViewStack it throws the aforementioned error. No doubt the answer is pretty obvious so here's the constructor for the manager class that holds my ViewStack.
stack = new ViewS...
Sometimes I'm solving problems on projecteuler.net. Almost all problems are solvable with programs, but these tasks are more mathematical than programmatical.
Maybe someone knows similar sites with:
design tasks,
architecture tasks,
something like "find most elegant C++ solution"?
...
Here is something that I find myself using from time to time and I just wanted to get some feedback on the merits of the practice.
Lets say that I have a base class:
abstract class RealBase {
protected RealBase(object arg) {
Arg = arg;
}
public object Arg { get; private set; }
public abstract void DoThatThingY...
Hello,
I am trying to override a method on a control in the Community Server SDK called 'InlineTagsContainerTagEditor'.
When I find the source for this control, it is inside of a file with another class called 'TaggableContentTagEditableList'.
Here is what I think the relevant parts are:
namespace CommunityServer.Controls
{
publi...
My development team has run into a design issue. I'm hoping someone can help me clean this part of the architecture up a bit.
In my system, I have an enum with 250 members [one member represents a distinct drop down]. In order to populate the drop downs on any given window, that form sends in the enum members that relate to the drop do...