design

shared functionality between C# console apps

I have two console apps, Query and Update, that share some functionality. I wanted to have the two classes inherit from a common base class, but the problem is that, for a console app, I have to have a static Main function. What I currently have is the following: namespace Utils { public class ConsoleBase { protected c...

Design Developed Program(make it easier to use and better looking)

Hi all and thanks! that second time i'm asking this question here, first time i didn't explain my self well enough. I've developed a windows forms software in C#, the form is very simple with regular buttons, etc...I want to make it look better, much more better, as example, how did microsoft designed the zune player? my question is actu...

Refactoring to Asynchrony?

I program ActionScript for the FlashPlayer. This means compiling a set of ActionScript files into a SWF file (a bunch of bytecode that gets executed by the FlashPlayer in your browser). Anything that is not compiled into the SWF file must be requested. Examples of this would include ANY textual content, media, or graphical content that w...

What is the right way to design an adventure game with PyGame?

I have started development on a small 2d adventure side view game together with a couple of people. The game will consist of the regular elements: A room, a main character, an inventory, npcs, items and puzzles. We've chosen PyGame since we all are familiar with python from before. My question is quite theoretical, but how would we desig...

How to initialize a class?

The problem is really simple, I have a class "Stock", I want to load its property "StockName", "StockCode' from the db. so which patten should I use? pattern 1) Use service class to create it public interface IStockService{ Stock GetStock(string stockCode); void SaveStock(Stock stock); } p...

Design Problem - Common base class and different return types

What I have? I have an abstract class QueryExecutor and many classes inheriting from it, I have just given two of them. The logic of constructing the result object is same but, each inherited class returns a different collection - some of them are in System.Web.UI.WebControls namespace and some are custom collection classes. abstract c...

Service method or domain static method in Grails?

Hi, This is a design question : when do I need to create/use a static method (in a domain class for instance) and when do I need to create/use a service instead? What is the difference between them ? Thank you. ...

In a user interface, is it better to "gray out" or hide features that are unavailable?

In my particular situation, I have a comment form than cannot be used until the user has logged in and joined a specific topic. Then, they can comment on that topic. In your opinion, should I hide the comment form completely, or disable it and prompt the user to complete the necessary requirements. ...

Visual studio like panels

Hello, I need to make some vertical docking/collapsible panels in the style of the Visual Studio IDE (like Solution explorer, Toolbox, Properties, etc...), does anyone know some examples or code for doing that? Thanks, R. ...

How should I use django models from other applications?

What is the proper way to use models from other django applications in my application? For example, should I simply go into the other application's models and add my functionality effectively coupling the two applications? Should I subclass the models using a django proxy model to add my application specific functionality? This method, ...

Why do floats having trailing .0 when it is exactly an integer?

Read this question carefully because I am not asking how to get rid of trailing zeros, that's easy. What I am asking is why does 123d become "123.0"? A IEEE 64-bit float can represent integers from 0 to 2^52 exactly, so this isn't a loss in precision but a decision during the implementation of Double.toString(). My question is why did...

Design for a data store that can be updated and queried against at the same time

We are designing a real-time inventory system for an e-commerce site that aggregates its inventory from multiple suppliers. Our visitors can search and purchase items from our site We get inventory updates from multiple suppliers on different schedules throughout the hour. The updates comes in the form of an inventory snapshot of the...

Resources to deepen knowledge before writing a framework?

I'm planning to reinvent the wheel by writing a PHP MVC/ORM framework in the near future. I have already watched several conference presentations on InfoQ, came across numerous slides, which have great impact on my knowledge. I'm still particularly interested in the best practices of: Framework design TDD (PhpUnit, Selenium) Domain D...

Gridview design: How do I split the gridview so it does not take full width of page?

Hi, I have a gridview control in my c# program which currently has 12 columns and 2 rows (1 row being the header). Is it possible to split the 12 columns so I have 6 columns and 2 rows and then below that another 6 columns and rows so it doesn't take up the full width of the page? Thank you. My gridview: <asp:GridView ID="GridView1" H...

Name of a class that wraps an external process?

What would you call a class that wraps some external process Worker (starts and stops it, reads stdin, stdout, etc.)? WorkerFacade? WorkerGateway? WorkerWrapper? ...

MYSQL: How can I store/retrieve a value based on the 3+ other values in the same table?

Let's say I'm making a program for an English class. I'd like to store data in this way: ID Object 0 Present Tense 1 1st person singular 2 To Be 3 I am How can I retrieve the value for ID 3 based on IDs 0-2? The only thing I can think of is: ID Object FromIDs 3 I am 0,1,2 The proble...

Available design solutions for a server-client protocol in a web environment

Hi, Let's say I have a server running as a service, I have a client that connects to the server exchanging information. This will work nicely on a "keep-a-live" application (a desktop application, another service etc.), but what are my option in a web environment? Create the client on each web call and connect to the server retrieving...

Most natural blinking visualization?

What is the ideal method for blinking information on a display to draw attention to an error condition in some data in a natural fashion. Should the blink be all on / all off, or should there be an aspect of fast ramp up and down of brightness instead of instant on / off transitions? Should the blink be equally on and off, or should it...

Should the status field in the output of a REST-style API call be a numeric code or a string?

I have a REST-ish API that returns JSON. One of the output fields is status, which indicates if the call succeeded. I gather that it's somewhat standard to use numeric status codes such as 200 success 400 syntax error 401 authentication error 402 general error 404 user not found 408 timed out 500 fatal error 501 not yet implemented ...

Where do I put business logic when I'm using the repository pattern?

Hi, I am using the Repository Pattern for my application. I have a class User. User is identified by Email. The UserRepository contains a method CreateUser(User user). There is a business rule saying that users should have a unique Email. I want to implement a transaction which first checks whether an email is in use and if not, the u...