design

what's the use of string.Clone() ?

there are 2 examples of code: # 1 string str1 = "hello"; string str2 = str1; //reference to the same string str1 = "bye"; //new string created and # 2 string str3 = "hello"; string str4 = (string)str3.Clone();//reference to the same string str3 = "bye";//new string created looks like they are identical aren't they? so what is ...

Select all checkbox with three states

Remember installing a program for example and you can check individually each item or you can check a 'select all' check-box at the top? And when some lines are checked the 'select all' box has a green fill inside instead of a check or being empty? What I'm trying to ask is what is the normal behavior for the 'select all' box? For exam...

Constructor injection in application where dependencies might not be able to be initalized

Hi, My application is able to start without a database connection, how do I handle this with IoC and constructor injection? Example: public class ApplicationShellPresenter(IRepository repository, IView view) { } When IRepository in this case will be constructed an exception will be thrown due to underlaying DAL cannot find config/f...

Is micro-optimization worth the time?

Hi, I am a PHP developer and I have always thought that micro-optimizations are not worth the time. If you really need that extra performance, you would either write your software so that it's architecturally faster, or you write a C++ extension to handle slow tasks (or better yet, compile the code using HipHop). However, today a work m...

Why are functions and methods so large in PHP?

I do not have a ton of PHP experience, but whenever I have been given legacy code or even recent PHP code, one thing that always strikes me is how BIG the functions are. In seems like every .php file as at least one page-long function in it. Is there any intrinsic reason why functions and methods in a dynamic, high-level language like PH...

How can I plan my software to avoid excessive rewriting and interdependencies

I'm writing a motor controller that has a couple of interfaces (buttons, Bluetooth, haptic knobs) which is a task that is steadily growing to be a larger than I figured. I've tried to just go at it by starting with low-level modules (e.g. write code to talk on the I2C bus), then ones above that (code to talk to a particular device on th...

Domain Driven Design in Performance Sensitive Platform (ex: mobile device)

Helo Guys, Currently I am looking to domain driven design and I hope You could give me some advice. Domain design seems a good thing since the business logic is implemented in the domain. It looks easier to be maintained once I have a good design. However I have problem to implement them in mobile application. This is a sample case. M...

Access $classA from $classB when $classB is called from $classA->__construct()

I think my title about says it all. During the __construct()-tion of $classA, $classB is instantiated. When $classB is instantiated it needs to access to another class inside $classA (i.e. $classA->classC). $classC has already been instantiated in $classA. Inside the __construct() function of $classB I am attempting to do something like...

Enhancement functionality to current system

I have a internet / intranet application. I am thinking of some enhancements functionality to the current ssytem. Normally what are the things i should look at or what are the common enhancements that people do? ...

Python design question (Can/should decorators be used in this case?)

I have a problem that can be simplified as follows: I have a particular set of objects that I want to modify in a particular way. So, it's possible for me to write a function that modifies a single object and then create a decorator that applies that function to all of the objects in the set. So, let's suppose I have something like thi...

Reverse engineer database from a read-only oracle database

Hello everyone, I would like to know if there is any tool able to extract the design from an existing Oracle database. I have a read access to it and I would like to have the design. Or simply export it to a *.sql and then read it with any tool able to create the design with the links between the tables. Something like that Thank you...

Visual Studio 2008 - Custom XML Designer

Hi Folks! I'm searching for a way to implement a designer/editor like the aspx-Designer in VS2008. We use a custom XML-Format and want to edit it graphically. We already have a Designer and want to integrate in VS. Is there a good tutorial? I want to adapt to features like "switch to code" (and those tabs at bottom of the window). So ...

Dealing with relationships and potential inconsistencies with DI / IoC

I'm having trouble designing classes to best make use of DI / IoC principles, particularly when a class shares a dependency with one of its dependencies (ie. X has dependencies Y and Z, and Y has dependency Z). An example will probably be useful: Lets say I have a class that will encapsulate some connection information for my app. Call...

What optimizations are premature?

I've been here for nearly a month and it seems that people have a tendency to be eager to use the "Premature Optimization is the root of all evil" argument as soon as someone mentions efficiency. What is really a premature optimization? What is the difference between what is essentially writing a well designed system, or using certain m...

Are TDD and POAD Competing Methodologies?

Over the summer, I've been reading a lot about design. Two notable pieces that I read were Test Driven Development: By Example by Kent Beck, and another named Pattern-Oriented Analysis and Design: Composing Patterns to Design Software Systems by Yacoub. These books take two very different approaches to designing software systems. My imp...

Any design patterns/coding methods for complex logic?

I had to clean up code for an online college application. There's nothing particularly wrong with it, but it was complicated. Different degree programs had different prequisites, fees, required documentation, and questions. On top of that, students coming from the military get different fees, and previous students pay no fees and skip...

What are some good UX books?

I am interesting in creating a better User Experience (UX). There are a lot of books out there, what are some that would be useful to a software engineer? ...

TDD type methodology for WPF / Silverlight

Has anyone got a TDD-ish methodology for designing complex WPF xaml components (i.e., ControlTemplates, Custom Controls with dependency properties)? Is eyeballing the UI the closest you can come to asserting your code is correct? How about incremental development; any aids to dividing up the logic incrementally? If there isn't any meth...

Where to Apply User Based Data-View Customizations?

I have a fairly large ASP.NET MVC 2 application that requires a large amount of user profile based data customization. This involves things like adding/removing table columns or applying user specific column headers in data returned by AJAX requests. There are dozens of types of customizations possible and there are many permutations sup...

How to program a super simple software activation system?

Hi, I have a piece of shareware that I wrote that I'd like to distribute on the internet. I have a serial number type thing set up but there is still a ton of key sharing :(. I'd like to add a system where once the user enters the serial, it is checked with my server to make sure that it is valid. Simplicity is key. -Client sends MD5 o...