design

Best practice approach to code structure in this situation?

Hey, I have a question regarding code structure, and was wondering what the best practice is or if there was a specific design pattern I should be using. I have an abstract base class BoundingVolume which can have subclasses such as BoundingSphere, BoundingBox, etc. A comparison has to be made between two BoundingVolumes to determine if...

Bind dynamic properties using JSF

I have a edit screen which displays a series of editable properties(fields) of an entity. And this list of fields are dynamic,in the sense that any field can be added/removed from the list without any code change. I have a model something like this. public class Property{ private String displayName; private String value; private int...

Design question about Web services and WCF

I have a service method with a couple of parameters that will be always provided and additional parameters that will change by names and number of parameters (I will know which parameters to expect by the ACTION field) To solve a design problem like the above I created a web service with the parameters that will be always provided and o...

Secret to achieve good OO Design

I am a c++ programmer, and I am looking forward to learning and mastering OO design.I have done a lot of search and as we all know there is loads of material, books, tutorials etc on how to achieve a good OO design. Of course, I do understand a good design is something can only come up with loads of experience, individual talent, brillia...

When to use which pattern?

Hello, As a junior developper, i'm a bit confused about some design patterns. Sometimes, i just don't know which to use in which context. For exemple, on creational patterns, i don't really know when to use: Factory Prototype Builder Actually, i see some differences; but i also see that you can use multiple solutions like: Callin...

Complex Cube desing Question

The Analysis team wants to analyze sales pipeline data. Our CRM system(Source system) send the Data Warehouse team transaction as the Product moves through the different stages. To mention a few: Creation, CallMade,LeadEngaged,CreditCheck,PapersReceived,Closed.There are more than 100 tracking statuses like mentioned above. Sample tran...

Java collections covariance problem.

Lets say we have a program which contains such classes: public interface AbstractItem { } public SharpItem implements AbstractItem { } public BluntItem implements AbstractItem { } public interface AbstractToolbox { //well the problem starts here... public List<AbstractItem> getItems(); } public ExpensiveToolbox implements Abstr...

Sending telnet commands and reading the response with Java

I work for a large organization that supports many different sites on a nation wide network. Our vendor supplies diagnostic tools for the hardware we use at each site. The diagnostics and reports are accessed via Telnet. The problem is we want to monitor all sites simultaneously and currently we can only check them one at a time (via ...

Inappropriate use of Builder pattern?

For a design patterns class, the instructor asked my team to develop an application that supports drawing and persisting glyphs, very similar to the WYSIWYG editor from GoF. My team decided to use a Layered architecture, with descending layers: Presentation, Controller, Logic, Persistence. The Logic maintains a collection of glyph repr...

Design of pointer container template

I would like to write a "versatile" class representing the general container storing pointers. Should I use public inheritance or containment? template <class T> class List : public std::vector <T *> { //... } Or template <class T> class List { private: std::vector <T *> items; //... } May some problems occur with abstract class...

Graceful exit for multithreaded haskell

This is entirely theoretical at this point, but I've been trying to wrap my head around this problem. Let's take a client for an example. There are forkIOd threads for every connection, and one of them wants to quit the entire program (ie. /exit). How would this information be propagated to other threads? This is not a condition, but ...

Designing an API - will this approach work?

First off - new to programming and know very little about API design. That said, I'm creating multiple web apps against a layer of web services and a shared data layer. The approach is simply to create several different types of functionality - i.e. user profiles, status updates, file uploads, rss feeds, etc... where each row in the va...

Coarse-grained vs fine-grained

What is the difference between coarse-grained and fine-grained? I have searched these terms on Google, but I couldn't find what they mean. ...

How can i structure a program (proces) with a very high number of IF statements

Hi, i have to create a program for a kind of complex proces. Well, the process is not complex, but there are a lot of variables which control the process. I can't in detail tell about the process, so i've made up one, which has the same load of IF's: the process is: should we stop the iron melt oven or not. We've got these parameters: ...

good place to discuss software designs (possible)

I was wondering if SO is the place to discuss some possible software design(s) ? What I mean by this is, Underlying problems youtube has, how CDN is setup , cloud issues, application architecture so on so forth Cheers. ...

Mixing component based design and the model-view(-controller) pattern

'm developing a 2D game and I want separate the game engine from the graphics. I decided to use the model-view pattern in the following way: the game engine owns game's entities (EnemyModel, BulletModel, ExplosionModel) which implement interfaces (Enemy, Bullet, Explosion). The View receives events when entities are created, getting th...

Best practices when implementing a scientific simulation methodology from scratch

Hi, in the field of scientific simulations (physics) I am thinking about developing some new simulation package in C/C++. What do you think would be the best practices when starting here from scratch? Can you recommend some bibliography? Thanks ...

Organizing and building a numpy array for a dynamic equation input

I'm not sure if my post question makes lots of sense; however, I'm building an input array for a class/function that takes in a lot of user inputed data and outputs a numpy array. # I'm trying to build an input array that should include following information: ''' * zone_id - id from db - int * model size - int * type of analysis - o...

HTML Buttons - Best Practices

Assume you have a customer-facing application hosted on a Web server. You have no control or knowledge of the customer's client. You also want an appealing design but you don't want to overwhelm the user with heavy graphics and/or obtrusive JavaScript. You've got a nice CSS layout with rounded corners but the default gray buttons stan...

Are there any PHP *websites* that have made their source available?

It's not hard to find example PHP code. The problem seems to be that most of it is frameworks/libraries/etc. This is great, but I'd like to see an example of an actual website. This stems from my perception that I can't build anything but "toys." My websites tend to be fairly CRUDdy, and it feels like my sites are a bit of generic MVC s...