I recently came across classes that use a configuration object instead of the usual setter methods for configuration. A small example:
class A {
int a, b;
public:
A(const AConfiguration& conf) { a = conf.a; b = conf.b; }
};
struct AConfiguration { int a, b; };
The upsides:
You can extend your object and easily gua...
I have the following C++ design problem and I would really appreciate any suggestion/solution.
Please notice that my background is not in computer science, so I may be missing some obvious solution.
The way I usually separate key components in the code is to define interfaces via abstract classes and pure virtual functions.
Example1:
...
I know how that question looks, but I'm quite serious. I am trying to create an application that will help me in learning databases (sql, queries, proper database design, etc). I'm using a pet project at work so I have something to focus on with actual requirements. The original project was written ("Frankensteined together", as the orig...
How can I modify my Menu so that it shows the color all the way through and not like this:
Here is my code:
<DockPanel>
<Menu DockPanel.Dock="Right"
Height="30"
VerticalAlignment="Top"
Background="#2E404B"
BorderThickness="2.6"
Foreground="#FFAA00">
<Menu.Bi...
I'm currently in school and for my Senior Project we have to spend 1/3 terms just doing UML diagrams and other tedious documentation for our project.
This involves alot of designing and planning for future problems that have yet to occur.
For some reason this seems to be to encourage over designing. I've spent the last hour writing stu...
Background:
The application I am working on happens to be web-based, but the question applies to any GUI. I need to request three distinct pieces of information from the user four times -- each set is for one of four servers. There is no commonality between the sign-on for each server, or in other words, the four sets of credentials a...
While designing ORM, what is the best approach to represent the relationship, performance-wise? I mean, out of the following two, which approach is best considering performance?
class Employee
{
int ID { get; set; }
String Name { get; set; }
int DepartmentID { get; set; } //This approach uses DepartmentID
}
--- OR ---...
Q1. Why are callback functions used?
Q2. Are callbacks evil? Fun for those
who know, for others a nightmare.
Q3. Any alternative to callback?
...
I find myself very often creating an object that has no public methods and is self-contained. It typically handles events of arguments passed to its constructor in its private methods and does not raise any events or expose any public methods.
I am calling this type of objects "passive" objects - objects that do not have any public meth...
I am creating an android application that has a lot of different screens where the user can navigate to those screens using the buttons or list provided in those screens. What would be the best way to design the entire app's navigation flow? Should I map each screen to be View or an Activity? Can an design an entire android app with just...
I have a UI with a grid. Each record in the grid is sorted by a "master" sort column, let's call it a page number. Each record is a story in a magazine. I want the user to be able to drag and drop a record to a new position in the grid and automatically update the page number field to reflect the updated position. Easy enough, right?...
Hello, I have been looking for a good PHP MVC framework that is interested primarily in speed, security, and implementing the MVC design architectural style.
Some of the biggest beefs I have with a lot of the mainstream MVC frameworks out there is that they:
put view logic in controllers, or do things like:
controller: $form = "a for...
Seems like Go is designed as a replacement for problems you previously would have solved with C++. Is this an accurate statement? What kind of solutions is Golang (Google Go) designed for?
...
I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for the web? I mean, with a predefined list of widgets that can be defined using a markup language and then control them using code?
I have c...
I'm currently working with an online application that requires multiple screens/steps in order to complete. The application domain is modeled using an object graph. Persistence to and from a database is done using an ORM package.
As I progress through the screens I build up the object graph. Between screens I serialize/deserialize the o...
Service provider frameworks generally there have two systems viz. OSS(Operational Support System) and BSS (Business Support System). Theses systems are separated by deployment constraint, in most of the cases one has one bss deployed per 'n' number of oss sites.
While designing any such framework is it advisable to have database separat...
Hey,
I am pretty sure most of you know about the minesweeper game. I wanted to code (in C#) my own minesweeper game and was looking for some input as to what would be a good algorithm for that game. I have been browsing over the web for quite some time now but could not find a good solution. Can anyone help me with it?
Thanks
...
I can't understand the reasoning behind Most-Recent-Order (how Windows sorts windows when switching via Alt+Tab) when used for tab/window/document/task switching. The way Firefox does tab switching (tabs stay in a consistent order, Ctrl+Tab/Ctrl+Shift+Tab for moving to the next/previous tab) seems much more natural than switching in chro...
Today is jQuery day. I found this in the documentation:
blur() Returns: jQuery Triggers the blur event of each matched element.
blur(fn) Returns: jQuery Bind a function to the blur event of each matched
element.
In other words, the behavior of the function is totally different depending if it accepts or not an a...
as from title. Is it considered acceptable that two methods, say foo() and foo(int), perform two unrelated operations ? and why ?
Edit : thanks. I see that I am not the only one thinking that is heresy. :)
...