design

C: Throw error on parameter check or let it hit the fan ?

Hi everyone, I have a simple design(?) question. I'm writing a simple program, that has a couple of functions that look like these. float foo (float* m,size_t n){ float result; //do some calculations, for example a sum return result / n; } I have a couple of questions on this, with no intention of re opening some holy ...

Chat server design of the "main" loop

Hey, I am writing on a small tcp chat server, but I am encountering some problems I can´t figure out how to solve "elegantly". Below is the code for my main loop: it does: 1.Initiates a vector with the basic event, which is flagged, when a new tcp connection is made. 2. gets this connection and pushes it back into a vector, too. Then w...

Design question in Python: should this be one generic function or two specific ones?

I'm creating a basic database utility class in Python. I'm refactoring an old module into a class. I'm now working on an executeQuery() function, and I'm unsure of whether to keep the old design or change it. Here are the 2 options: (The old design:) Have one generic executeQuery method that takes the query to execute and a boolean com...

Design: Queue Management question (C#)

I want to build a windows service that will use a remote encoding service (like encoding.com, zencoder, etc.) to upload video files for encoding, download them after the encoding process is complete, and process them. In order to do that, I was thinking about having different queues, one for handling currently waiting files, one for fil...

What features or concepts annoy you in Qt?

Qt is a nice framework and great UI toolkit and it has many useful features and concepts. Most of us probably agree that Trolltech, lately Nokia, have done pretty nice job developing it. One of the latest advances in Qt is QML, which I find fascinating advancement. However, I find some of the concepts badly designed or badly implemented...

Separating View from Model in webapps

I often see web applications where a program is basically some javascript objects wrapping DOM objects. These JS objects perform all model, controller, and view functionality. This seems ok to me with older style web applications where there really wasn't much model or controller functionality, but in newer more interactive application...

Why should I do manual double buffering? (C#)

I am working on a game in C# (either 2.0 or 3.5 havn't decided yet). The game will be played on a map with a hexagonal grid. I appreciate that the UI for this map should use double buffering (lots of layers, so slow drawing). I know that I can enable double buffering through a style, or create my own buffer and handle it myself. Most...

Design question: Java Class with single method ok?

I need the following functionality Given two sorted lists, merge them I have this skeleton Java code: public class MergeLists{ public List merge(List l1, List l2){ List l3; // merge l1, l2 in to l3 return l3; } public static void main(){ // populate list1 and list2 MergeLists ml = new MergeList...

Hibernate: Better monolithic class or many class maps?

I am making a website with GWT and using Hibernate to connect to the database. Every time a user loads a page and it is required to grab information off the database. Is it better to have monolithic classes containing all the getters/setters for the tables, and select the information as needed, or is it better to have many different cla...

What is a best practice method to log visits per page / object

Take my profile for example, or any question number of views on this site, what is the process of logging the number of visits per page or object on a website, which I presumably think includes: Counting registered users once (this must be reflected in the db, which pages / objects the user has visited). this will also not include unre...

architectural design

I am designing an Invoice Management system... Its an intranet system. I am writing technical specification document. The document has description of architecture. So my architecture has 3 layers.. 1. Database layer. 2. Business Logic layer. 2. User Interface Layer. Do I need to include another layer "Intranet/internet layer" in between...

Tips or Guidelines on Designing and Building J2ME Applications

Are there guidelines or tips on designing and building J2ME applications? ...

Why is there no CSS-like GUI creator

Okay, so this will probably be closed or whatever, I don't care. I have to say this because it just frustrates me like hell. Once upon a time, I came from a html/css/php background into the vast deeps of application development. I wandered around the valleys of Java and explored the mysteries of C#. I gasped at the beauty of Ruby, fell ...

database table design

I design the tables as below for the system which looks like a package delivering system For example, after user received the package, postman should record in system, and the state(history table) is "delivered",and operator is this postman, the current state(state table) is of course "delivered" history table: +---------------+-------...

Smartphone app design document template?

Hello all, Im looking for a design document (templat) for smart-phone applications, I don't really mind which platform, because it should be easily transferable! I am aware that there are lots of widget & icon design guide lines available but I am also looking for some more high-level, well-rounded design such as use-case, uml diagrams,...

looking for old or new paper, books on spreadsheet program design.

Hi I have used various spreadsheet programs but as a programmer I would like to know and understand spreadsheet programs themselves and how the work and are designed. Does any one know of a resource where I might find this information. Thanks ...

What is the philosophy of managing memory in C++ ??

Apologies for the vast scope of question. But what is the design factor in managing memory in C++? For example: why is there a memory leak when a program does not release a memory object before it exits? Isn't a good programming language design supposed to maintain a "foo-table" that takes care of this situation ? I know I am being a bi...

Optional Arguments in Python

What are the advantages of having Optional args in Python. Instead of overloading one function (or method) with args + optional args, wouldn't Polymorphism with Inheritance suffice? I am just trying to understand the burning reason to have this feature. or is it the case of being able to do one thing many ways? P.S: I can see that it m...

Using accessors: Good or bad?

I'm having a design issue I could use some advice on. Let's say we need (how original...) Employees in our new application. What I would normally do is something like this: public interface IEmployee { string EmployeeId { get; } string Name { get; } void Update(string newName, ...); ... } public class Employee : IEmploy...

Flex: how is loose coupling achieved by using interfaces?

Ive looked this up in a few different locations, but to be honest, i dont really get it. I get what loose coupling is, but not how interfaces in Flex would help to achieve it? ...