design

Server asking the Client for information?

In a client-server system, is it considered good architecture for a server method to "ask the client" for more information? If so, what's the best way to design such a scenario? Is there a "pattern" for this? For example, suppose the end user selects a set of records they want to delete in the client UI, then the client makes a "delet...

Loose Coupling vs. Information Hiding and Ease of Change

I'm just reading Code Complete by Steve McConell and I'm thinking of an Example he gives in a section about loose coupling. It's about the interface of a method that calculates the number of holidays for an employee, which is calculated from the entry date of the employee and her sales. The author suggests a to have entry date and sales ...

Designing a cross-platform API

I'm in the process of designing some code "packages" (as we call them at my company) which provide fairly generic functionality, and I would like to find a way to standardize the API across all languages that we are working with. I'm thinking about designing the classes and test cases to be the same for each language, but leaving the im...

Should I prepare my code for future changes?

Should I prepare my code for possible/predicted future changes so that it's easier to make these changes even if I don't really know if these changes will be required anytime? ...

How do you manage external dependencies for your application?

There are many types of external dependencies. Interfacing with external applications, components or services (e.g. Outlook to send emails, TWAIN or WIA for scanning, ActiveX objects and Web services for various purposes, and so on). What is your strategy for making sure that your application is robust, and can run even when such extern...

Do static classes cause performance issues on multi-core systems?

Hi folks, the other day a colleague of mine stated that using static classes can cause performance issues on multi-core systems, because the static instance cannot be shared between the processor caches. Is that right? Are there some benchmarks around proofing this statement? This statement was made in the context of .Net development (w...

Java data object for bidirectional I/O

I am developing an interface that takes as input an encrypted byte stream -- probably a very large one -- that generates output of more or less the same format. The input format is this: {N byte envelope} - encryption key IDs &c. {X byte encrypted body} The output format is the same. Here's the usual use case (heavily pseudocode...

Improving a Web Login Screen

Hi there folks, I'm trying to get some ideas about how to develop a web login screen. I'm using DynamicData Webforms, so most of powerful frameworks offers a lot of options, but I'll be very grateful to read your suggestions. Thanks in advance Edited: beyond the functionality, I'll want to read your view-point about the presentation mo...

Does the code-to-interface principle apply to entity classes?

I'm trying to follow code-to-interface on a project. Should I be creating an interface first then implementing that interface for entity classes? I'm thinking this might be taking the interface first approach too far and entities should be ignored. This is what I mean... public interface Address { public String getStreet(); publi...

Dealing with application redesign

I am working on a project to redesign/ redo an application. The problem is that the old application was written in ASP.net 1.0 and the database is pretty large over 100 tables and 300 odd views.The database handles roles and membership in a very shoddy way. It involves a simple workflow too. The app is pain when it comes to maintainence....

Help with positioning logo/navigation links

Screenshot of the problem: http://i36.tinypic.com/dfxdmd.jpg The yellow block is the logo and the blue box is the nav links (I have blanked them out). I would like to align the links at the bottom so they are stuck to the top of the body content (white box). How would I do this? Here is the relevant CSS and HTML. #header { height:...

ROR: To scaffold or not?

I love scaffolding and it extremely helpful for prototyping. But Should we use scaffolding for developing application as such? ...

Help with design

I think I am pretty good with programming C# syntax. What I am looking for now is some resources, books(preferable), websites, blogs, that deal with the best way to design object oriented Desktop Applications and Web applications, especially when it comes to data and databases. Thanks ...

What makes user interfaces appealing to you?

This is a question for anyone that has dealt with UI's or has a passion for UI's. There are numerous good user interface designs. Ranging from the iPhone UI (Black transparency w/blue highlights), to Windows XP (Blue and green fisher price), to Mac OS X (Blue/Grey matte), to the colourful World of Warcraft UI. What makes one user inter...

Good design: How to pass InputStreams as argument?

Hello! I've got a big file on which I'm opening a FileInputStream. This file contains some files each having an offset from the beginning and a size. Furthermore I've got a parser that should evaluate such a contained file. File file = ...; // the big file long offset = 1734; // a contained file's offset long size = 256; // a containe...

Good resources on programming language design?

Javascript: The Good Parts is a great book. Often I find myself reading passages like the following from the perspective of a language designer: undefined and NaN are not constants. They are global variables, and you can change their values. This should not be possible, and yet it is. Don't do it. Takeaways: Don't change the valu...

API Design: Expose XML or Objects

We're embarking on a new middle tier service that will allow internal client systems to create and update and query records in some underlying data stores. The service will aggregate as many as 3 seperate underlying datastores. For the purposes of this question assume: Data store #1: Proprietary XML Database. Data store #2: Off the ...

DB Design: more tables vs less tables

Say I want to design a database for a community site with blogs, photos, forums etc., one way to do this is to single out the concept of a "post", as a blog entry, a blog comment, a photo, a photo comment, a forum post all can be thought as a post. So, I could potentially have one table named Post [PostID, PostType, Title, Body .... ], ...

How do you manage and organize your game components?

Hi folks, in my spare time I'm engaged with writing a little game using Microsofts XNA framework. Reviewing the very first prototype which I wrote to get aquainted with XNA, I found it annoying that there is no possibility to structure my (drawable) game components in a hierarchical manner. I was close to implement a kind of Composite(D...

Best way to compare objects by multiple fields?

Assume you have some objects which have several fields they can be compared by: public class Person { private String firstName; private String lastName; private String age; /* Constructors */ /* Methods */ } So in this example, when you ask if: a.compareTo(b) > 0 you might be asking if a's last name comes be...