I heard composition is preferable over inheritance. So when I design my simple game engine I tend to do the following:
instead of:
Is this a good approach, or should I reconsider?
Edit: To clarify the notation. The arrows means inheritance, the arrows with a diamond means composition and the <<>> means interface. More info on the ...
Hi to all,
We have a very large app which has been designed exclusively by a single developer who is a bit reluctant to give too much information out on how it has been put together.
We were thinking about using a UML tool for educational purposes so others can start to learn and take ownership of the code but with the the large code b...
We are moving our Delphi application to a new environment – it will be .NET. Some parts of an app will be moved to distributed processing, some will be moved to web servers. Therefore, this is an architecture shift from monolith desktop application to distributed system. Migration of current Delphi code to .NET is an issue itself (some c...
I'm working on an internal company website. Standard operation - search for an item, from a list, select one item.
After clicking on an item in the list, should the next page be a webform with text boxes and other form controls to allow me to edit the entity or should it be a summary of the details? For a summary I would then select an...
hi, i've some difficult to explain my problem, because i'm also not good in english :|!
I've the following code
namespace StighyGames.MyGames {
public class MyGames
{
...
...
CarClass myCar = new CarClass(...);
Main () {
MyGames game = MyGames(...);
}
}
Game is my "main" object (my application).
In my CarClass i've ...
hello!
i am about to develop a small application that should consist of a server and a rich client.
so far i will follow the following design guidelines:
never expose domain objects to the client
encapsulating service messages to response and request objects
identify service routines based on use-cases, so that they are always atomic
...
I'm still learning the ropes when it comes to implementing custom editors for complex properties at design time.
As a simple starting point, I'm trying to enable design-time editing of a property of type ICollection<string>.
What I've done so far is:
Wrote a StringsEditor class, which derives from UITypeEditor and displays a drop-dow...
I am trying to distribute my image HTTP requests across multiple domains for faster performance.
Is there a CDN (Content Delivery Network) out there hosting common web site icons (or sprites of icons)?
Example: Like carrots, arrows, icons for file types, or 50% opacity of black png.
FYI - I am NOT talking about hot linking. Yes, I u...
This is a design question.
Background: We get a web request into our system from many different websites (for a widget that we give out), from which we grab the referrer string (if it exists). We use the referrer to decide on some things within the application. The problem arises in that I need to look at a list of "sites" (urls, partia...
I'm obviously not looking for any actual code necessarily, but more of someone to point me in the right direction. I'm trying to convert our training lists from paper to a digital format but the manager wants to keep roughly the same format intact. This would be a great project for a database type setup but im wondering how to approach i...
I have the following design problem. I have a list of items and I want to make the whole of each of the first li to be a clickable link. I have tried adding a link in each li, making it a block level element and positioning it absolute, but that doesn't work because the parent and all li's are floated left for layout purposes. Any help w...
I've tried looking for this but can't find anything:
<asp:Login id="Login1" runat="server"
TitleText=""
CreateUserText="<br />Register a new account"
CreateUserUrl="register.aspx"
PasswordRecoveryText = "Forgotten password?"
PasswordRecoveryUrl="getPass.aspx"
UserNameLabelText="User...
Hello
I have class A. Class A is responsible for managing the lifetime of B objects and it contains container of B objects that is map<BGuid,B>, and each B object contains container of C objects which is map<CGuid,C>.I have one global A object for the entire application.
I have the following problem:
I have CGuid object and I want to u...
Hi
I have an app in C++ which actually processes a binary file. The binary file is a collection of events say A/B/C, and on detecting event A in the file, the app handles the event in "handler A".
Now i need to write another script in a custom language, which gets executed orthogonally to the binary file processing. The script can hav...
I'm trying to find research/advice on a particular code refactoring pattern, but I'm finding it hard to locate, since I'm not sure whether there's a good name for it. It's very similar to factoring out repeated code, except the code wasn't repeated in the first place: it was just stashed away in a conditional branch of a larger function...
I have the following class:
class PluginLoader
{
public:
PluginLoader(Logger&, PluginFactory&, ConflictResolver&);
//Functions.
private:
//Members and functions
};
Logger, PluginFactory and ConflictResolver classes are all interface classes which will be implemented in the application. I create the single PluginLoader obje...
I ask this question as I have a lot of free time coming up and want to further myself in web design and web programming. I want to know how I can MOST EFFECTIVELY achieve a high level of skill and expertise for designing, maintaining and creating websites.
I believe in learning by doing, and that's how I have been progressing so far. I...
I am starting a project that involves coding a Black-Box Trading Bot for a strategy one of my friends created, and I was trying to think of what the best design pattern would be.
My current thought is that I should use the Actor model to allow for lots of concurrent calculation and information passing.
Anyone else have any ideas? Or ag...
Of these two designs for a crossroad database
#Street
street_id | street_nm
#Crossing
crossing_id | x | y | street_id_1 | street_id_2
VS
#Street
street_id | street_nm
#Crossing
crossing_id | x | y
#street crossing relationship
street_id | crossing_id
Assuming every crossing has only exactly two roads, is there a reason why one wou...
A data provider (java, hibernate) has an API for accessing instances of JPA-annotated classes. A web-service (jax-ws) is exposing the API to the network clients. A bit of a problem I'm thinking to solve is that a client of the data provider cannot be easily reconfigured to either use the provider directly or over the web-service. The rea...