design

Retaining persistent information on different versions of the software.

I am planning to write a free version and a full version of a software. I want the information stored by the free version of the software to be accessible by the full version also (I don't want to use Content Providers). And I also want to make sure this data is not lost when the software is updated. How do I achieve this? ...

Best way to allow text edit completion on a complex iPhone UI

I have a somewhat complex iOS view hierarchy. One piece of text is an editable UITextField. When the user touches it, it becomes first responder, and is editable. Here's the rub, though: Best practice should be that a touch anywhere outside the edit control causes it to resign first responder and end editing. What's the best way of acco...

Is this a valid use of NULL foreign keys?

Hi. Consider this very small contrived subset of my schema: SensorType1 ID : PK SensorType2 ID : PK Reading Timestamp Value SensorType1_ID FK -> SensorType1 SensorType2_ID FK -> SensorType2 Some readings are for SensorType1, some are for SensorType2. I would probably add a constraint to ensure exclusively one of those FK's is alway...

Design decision to execute multiple searches on a large set of strings - google app engine

Here is the scenario. The user (web environment) can import a document in a foreign language. When displaying the document the application highlights the words the user does not know yet. The user can then mark some of those words as known, adding them to his dictionary. So basically we have a List of Strings representing the words in t...

JSF2 Design query on ManagedBean

I am new to JSF2 and would like to know something from a design perspective. For e.g. if we have multiple multiple usecases based on various actor types, which is better way in terms of design by considering below two scenarios? e.g In a module having total usecases count say 10, (Scenario 1) in this scenario for 1st & 5th usecase(UC)...

Code refactoring on bad system design

Hi all, I am a junior software engineer who've been given a task to take over a old system. This system has several problems, based on my preliminary assessment. spaghetti code repetitive code classes with 10k lines and above misuse and over-logging using log4j bad database table design Missing source control -> I have setup Subvers...

Is there a web app that helps with a web dev checklist?

I was wondering if there is a website that helps with giving you a checklist for your web app, to make sure you don't miss anything!! It could be very tedious when building a large project by yourself! obviously nothing specific, just a guideline for a web app. thanks ...

Ruby On Rails Design Question: What if I make a mistake?

I still learning Ruby on Rails, but have been wondering what happens if I make a mistake. For example, if I scaffold and make a typo, what do I do? If I don't do scaffolding, generate a model, rake db:migrate it and find out I need to ad a column or delete one, what do I do? Is it better sometimes to use a third party manager on the d...

android, object oriented programing vs designing for performance

I am a complete noob to android but I have been programing c# for a long time. I am writing an android application and have gotten to a point where the c# programmer in me wants to start creating a loosely coupled design and and moving code into different layers, using interfaces, etc. But then I stumble upon the Designing for performa...

How should I design a mechanism in C++ to manage relatively generic entities within a simulation?

I would like to start my question by stating that this is a C++ design question, more then anything, limiting the scope of the discussion to what is accomplishable in that language. Let us pretend that I am working on a vehicle simulator that is intended to model modern highway systems. As part of this simulation, entities will be inter...

Why is MVC so popular?

I was originally going to make this a longer question, but I feel like the shorter I make it, the better you'll understand what I mean. The MVC architectural pattern has 3 dependencies. The View depends on the model. The Controller depends on the View and Model. The Model is independent. The Layers architectural pattern defines N - 1 d...

Why doesn’t java.util.Collection define next(), hasNext() directly?

If Collection defines hasNext() instead of iterator().hasNext(), we could write loop easier: while(collection.hasNext()){…} instead of: Iterator it= collection.iterator(); While(it.hasNext()){…} Of course, I know easy way for loop for(E e:collection) exists. Why interface Iterator exists? ...

Being observable

What does it mean: Object's observable state? I was reading yesterday in "Exceptional C++" Solution to item 43 and there is a fragment: private: void InvalidateArea() { area = -1; } Even though this function modifies the object's internal state, it should be const. Why? Because this function does not modify the object's observabl...

When does an object qualify as a DTO?

Hi, DTO (Data Transfer Objects) are objects used to transfer information between multiple subsystems of an application, often separated by either a network or a process boundary. This is my understanding. However, from Java perspective, do the subsystems/modules have to be on different JVM instances for the objects they use between...

How and when to apply business rules?

Hi, Suppose I have a service StateService which has a method ChangeState. ChangeState(State toState, DomainObject object) I have business rules that checks whether the destination state is valid or not in the domain objects current "state", how can I technically check those rules without first setting the toState on the domain object...

correct design pattern for employee vacation program?

Hi! I have what seems to be a simple employee time request web application I have to make (C#, Silverlight or ASP.NET). An employee can request vacation time, sick time, maternity leave, comp time, etc (there are probably about 10 different types of leave and could be more in the future) and their manager has to approve each request. ...

So I want to do a web app, where to start?

As a programmer my first instinct is to start coding, but then again chapter one of every programming book says that you should NOT sit down and code. So the question is, where to start? I've given the project some thought, it's going to be a fairly simple web app, kind of a time logging app, to give you an idea. Even though it's a sm...

nginx and apache web servers

This question is not nginx vs apache. I am more interested in the architectural advantages of NGinx over Apache. As I was able to understand - nginx is an asynchronous, event-driven, web-server which outperforms Apache by a huge margin. Why is this? Where does Apache fall behind? ...

Maintaining positional integer value for numerous entries whose positions may change

At the moment I have an ArrayList containing EPL printer commands. In each command it has a line position. eg/ myList.Add(string.Format(CultureInfo.InvariantCulture, "A26," + YPos + ,0,4,1,1,N,\"Date Printed : {0}\"", DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss"))); myList.Add(string.Format(CultureInfo.InvariantCulture, "A26," + YPos...

How can I see a list of fonts available in my blackberry?

Right now I'm setting a font to my application, but I was just following an example. How can I know what fonts I have available to me? FontFamily alphaSansFamily; try { alphaSansFamily = FontFamily.forName("BBAlpha Serif"); Font appFont = alphaSansFamily.getFont(Font.PLAIN, 9, Ui.UNITS_pt); setFont(appFont); } ca...