design

Event Driven versus Polling/Scheduling

Hi Gurus, We currently are in a debate within our IT group over what the best practice is for handling the majority of all of our processes. Our IT director is pushing for everything to be event driven. His reasoning is that is will save on resources and it is the "best method" for sending ship notifications, order validations, order p...

What Is a Good Layout for a Standard Error Log File?

I am trying to design the error and warning log file for my desktop program. As my program reads the user's input file, it may find syntax errors or invalid data of some sort. Once everything is read and the program is processing the data, more problems may be found. I want to write messages about these into a simple text file. I may...

Design pattern for a database application that must work disconnected

Hello, I have to design an application is mostly an interface with a database for data entry. The application must be able to work while it is disconnected from the database with cached data and insert that data when it has connection again. There will be two different modes, connected or disconnected, no need to detect disconnection in...

Creating a library of template functions

I've been developing a library of mostly template functions and managed to keep things organized (to some extent) in the following manner: // MyLib.h class MyLib { template<class T> static void Func1() { } template<class T> static void Func2() { } }; And obviously calls would be made like this: MyLib::Func1(); As y...

Does anyone design api or library code in this way?

I was reading up some things about how to design a library or API well, and stumbled across Joshua Bloch's great talk at Google Tech Talks. Now although I am nowhere near a professional API developer, I think programming a bunch of classes/functions is a similar, although much scaled-down version of the same thing - clear-cut separation ...

Is good multithreaded design premature optimization?

While i like the intellectual challenge coming from the design of multicore systems i realize that most of them were just unnecessary premature optimization. But on the other hand usually all systems have some performance need and refactoring it later into multithreading safe operations is hard or even just economically not possible bec...

What all Design Patterns can I use ?

1. I need to build a "Web Service Server (Simulator)" which generates the xml files and also sends async calls to the client for notification. At this point, I am writing a code to generate dummy XML files which will be used for testing (FileGeneratorClass-- builder)? 2. Also, can I implement this in a way that I do not have to write a...

design patterns for concurrent programming???

hi has anyone implemented design patterns for concurrent programming. If so did you have any implementation issues/difficulties?? Thanks ~Sanjay ...

PHP 6 not backward compatible

From what I read, PHP 6 will break a lot of php scripts. I understand the reasons why it may break but why don't they just keep the PHP 5 and simply call PHP 6 as a different language based on PHP syntax? Like for example, why not just call php 6 scripts with an extension, "p6"- why are they trying so hard to make it backward compatible ...

Managing Website Stock Content

I'm forever downloading elements that I think will be useful when designing or developing a website - icons, fonts, psd's etc. The trouble is i've so much of this stuff, I don't actually know what I have already! I've tried breaking it down into relevant folders and sub folders and this used to work. But I'm wondering how other desin...

Property with Enumerable or list

I'm playing around with LINQ and related subjects and was wondering about the following. I've 2 methods of getting a Fibonacci sequence. I started with: public static IEnumerable<int> Fibonacci { get { int i = 0; int j = 1; int temp = 0; while (true) { ...

Java: interface / abstract classes / abstract method

Please help :/ In Java you can create an abstract class that contains only abstract methods. On the other hand, you can create an interface that declares the same methods. So can you use abstract classes instead of interfaces? Cheers! ...

Design choice for sound effects

I'm trying to decide how I want to implement sound effects in my program. I've debating between 2 options. 1) Create an abstract interface SoundEffect and have every sound effect derive from that. Each sound effect is its own class. Upon construction, it opens the sound file and plays, and upon destruction it closes the file. The main d...

Generic Alpha Beta Search with C++

I'm trying to design a function template which searches for the best move for any game - of course the user of this function template has to implement some game specific functions. What i'm trying to do is to generalize the alpha beta search algorithm with a function template. The declaration of this function template looks like this: ...

What sort of database design would I need to use in case I wanted users to save tags, and be able to call already used tags?

I'm trying to implement a feature similar to StackOverflow's tag feature. That a user can create a new tag, or by typing pull up a list of similar tags already created. This is such a wonderful feature on this site and I find it sad that most sites do not have something like this. It's both robust, and yet very very flexible and best of...

Mobile version of my website, what design width is optimal?

Hello, I'm going to create mobile version of website... What width should I choose for design? I know that every device have it's own screen width and it's really difficult to fit all devices... I'm really confused (pretty new to mobile websites world), please help. Thank you. ...

Design question: Dynamically changing GUI -> sending implementation classes as soap attachments.

Here's a scenario: I have a java front end (RCP/SWT) app which currently has no authentication support. I have to however, add security to this application so that it gets deployed in different enterprise envinronments. I have a few approaches which I thought I would share with you all here and take your inputs. Please note that there a...

API Design for Task/Parallelization Library

I've just completed a significant revision of my task pool/parallelization library for the D programming language. I'm interested in having the API critiqued, especially by people who are not regular users of D, but know a decent amount about use cases for such a library. I'd like to avoid the groupthink that would be created by asking...

Rails design doubt: Should/could I load the whole dictionary/table into memory?

I am a newbie working in a simple Rails app that translates a document (long string) from a language to another. The dictionary is a table of terms (a string regexp to find and substitute, and a block that ouputs a substituting string). The table is 1 million records long. Each request is a document that wants to be translated. In a fir...

Best Design Pattern for HttpRequestDispatcher?

Hello, What's the best design pattern to use for an HTTP Request Dispatcher that has to do a "GET" or a "POST", return an output stream, parse the output stream, and then display the parsed results on an interface? Currently, I have an HttpRequestDispatcher.java in which a UI Class is defined in its constructor, and in the threaded run...