design

When do you trust the data / variables

We all know that all user data, GET/POST/Cookie etc etc needs to be validated for security. But when do you stop, once it's converted into a local variable? eg if (isValidxxx($_GET['foo']) == false) { throw InvalidArgumentException('Please enter a valid foo!'); } $foo = $_GET['foo']; fooProcessor($foo); function fooProcessor($foo)...

Which controls are being used?

Are there any tools available that allow you to 'look' at any given application and show you which WinForm controls are being used in that application? I happen to have an app which I like the GUI of, and I want to use a similar structure in my own app. Instead of developing these controls myself, it may be easier to buy them, if only I ...

Is it okay if my ViewModel 'creates' bindable user controls for my View?

I have an entry-point View with a tab control. Each tab is going to have a user control embedded within it. Each embedded view inherits from the same base class and will need to be updated as a key field on the entry-point view is updated. I'm thinking the easiest way to design this page is to have the entry-point ViewModel create and...

How to deal with interchangable base classes in Java

I have an issue with some inheritance I'm doing. Basically, I have an abstract class called LineCalculator, which, as it suggests, calculates lines of an equation. From there, I inherit this base class in a LinearLineCalculator, which calculates lines on a Cartesian coordinate system, and a PolarLineCalculator, which calculated lines on ...

Is it a good idea to work on header files only, just at the start of the project?

To explain my point further, I'm a beginner in programming, and I'm working on a small project. Instead of separating the .cpp file from the header file, I'm implementing the code in the header files, and making one .cpp file for testing. I do this to have less files, hence easier navigation. Then later I'll separate the code as it shou...

Is there a way to display floats correctly in Dreamweaver CS5 Design View?

Hi there, I'm setting up templates and snippets for my design team, they don't want to fuss with this that and the other. I figure fair enough, and everything's mostly going well, except that I'm experiencing difficulties in displaying floats in Design view. It's important to note that Live Preview displays beautifully, as does my outp...

How to create windows form to display properly in all monitors?

I have created a windows form using (vs.net 2008 and vb.net as programming lanugage). Functionality part is working fine as expected. My issues is that, when i run my application in different machines, the form display is not proper accross the monitory screen. In some machines i noticed extra space on leftside of the container. In som...

Do you use Styrofoam balls to model your systems?

[Objective-C] Do you still use Styrofoam balls to model your systems, where each ball represents a class? Tom Love: We do, actually. We've also done a 3D animation version of it, which we found to be nowhere near as useful as the Styrofoam balls. There's something about a physical, conspicuous structure hanging fro...

How to pass data to another droid device when the other device isn't expecting it

I am working on an application and one feature that would make it really useful is the ability to share some information, but the other device may not be expecting the data to be sent. For example, if I am reading a really good book, and I realize that a friend may like it, I could use an application to send the data to him, so he could...

Organizing Eager Queries in an ObjectContext

I am messing around with Entity Framework 3.5 SP1 and I am trying to find a cleaner way to do the below. I have an EF model and I am adding some Eager Loaded entities and i want them all to reside in the "Eager" property in the context. We originally were just changing the entity set name, but it seems a lot cleaner to just use a pr...

business object and codelist

Hi How to design a business object? I have a library which returns me an Object which have ten lists of other different objects. I need to store it into database all. List of objects are often like: class Item { private int id; private String name; private double point; } But the name is often the same. Like basic title of ...

Is Design Pattern only for Object-Oriented design?

I was wondering if all design Patterns are only used in Object-Oriented design? Are there any design patterns used in non Object-Oriented design? Thanks and regards! ...

What are some best practices for making sure your .NET code will scale well?

Last week I interviewed for a position at a TripleA MMORPG game company here in NE. I didn't get the job but one of the areas that came up during the interview was the about the scalability of the code that you write and how it should be considered early on in the design of your architecture and classes. Sadly to say I've never thought ...

Break a class in twain, or impose an interface for restricted access?

What's the best way of partitioning a class when its functionality needs to be externally accessed in different ways by different classes? Hopefully the following example will make the question clear :) I have a Java class which accesses a single location in a directory allowing external classes to perform read/write operations to it. ...

Editors to draw diagrams in Unified Modeling Language ?

I was wondering how you draw diagrams in Unified Modeling Language for your project design? By hand on paper or some editors on computer? It will be great if there are some convenient editors or other gadgets for help. I am programming under Windows and Ubuntu. Thanks and regards! ...

Configurable Values in Enum

I often use this design in my code to maintain configurable values. Consider this code: public enum Options { REGEX_STRING("Some Regex"), REGEX_PATTERN(Pattern.compile(REGEX_STRING.getString()), false), THREAD_COUNT(2), OPTIONS_PATH("options.config", false), DEBUG(true), ALWAYS_SAVE_OPTIONS(true), THREAD_WAI...

Explaining your system to a client

I'm currently developing a small Database Management System for a local company. How would you go about explaining how the system you have designed to a client? If they are non-technical and have no understanding of programming, how would you go about showing what the system will do and how it will do it? I guess some sort of visual repr...

Guidance for Workflow type applications

Hi, I'm looking for best practices and resources regarding design of workflow based applications. E.g.Best practice/guidance for: How best to represent business object 'states' (position in workflow) How to approach logging of transition between workflow states State transition rules I'm using .NET, but am rather looking for general...

difference between form id and form name used in html.

i want to know the exact difference between form id and form name used in html. ...

What Design Pattern is this?

I know that everything we do in programming can be described as design pattern(even abstract method has design pattern called template method) public class Guicer extends AbstractModule { private static Injector injector = Guice.createInjector(new Guicer()); public static void setInjector(Injector injector) { Guicer.in...