design

The shape inheritance example and "The Ruby way"

In my quest to transition from a decade of C++ to Ruby, I find myself second guessing how to accomplish the simplest things. Given the classic shape derivation example below, I'm wondering if this is "The Ruby Way". While I believe there's nothing inherently wrong with the code below, I'm left feeling that I'm not harnessing the full p...

How do i take two dict like class and wrap them together?

I want to take HttpContext.Current.Request and HttpContext.Current.Session and wrap them together into one class. Basically i want to write col["key"]; and have it check one of these for the key and if it doesnt exist to check the other. AFAIK they don't share an interface (i looked around using "Go To Definition" but i am pretty bad)....

JTable multiple filter design paradigm

As title says, i wonder if you could you direct me to some document, or give me advice here, on designing (GUI design) form which main part is occupied by jtable, which has several filters.Main goal is to avoid visual clutter. ...

How do I convince my coworker that methods with 26 parameters are bad practice?

Title says it all... we've debated this without any progress. Closest related questions I could find: How many parameters are too many? Worst Java practice found in your experience? What “bad practice” do you do, and why? ...

Design examples for themed GUI systems?

Can you suggest/reffer to any general design examples for implementing run-time changable themes in a GUI system? This seems to be quite a challenge. However, many GUI systems out there present this kind of functionallity, so there must be general design ideas that could be followed. Just to be 100% clear, design stands for programatic...

Is there such thing "the best abstraction" for a given design problem?

This question is regarding object oriented design. It may fit into community wiki. Usually , when one design a set of classes which communicate with each other through interfaces , he ask himself , what Interfaces should I make? How to abstract various sub-components in the system in order to achieve the design goals. If we put aside p...

Ruby on Rails: grouping blog posts by month

Hy guys. I've created a simple blog app with the usual CRUD actions. I've also added a new action in the PostController called "archive" and an associated view. In this view I want to bring back all blog posts and group them by month, displaying them in this kind of format: March <ul> <li>Hello World</li> <li>Blah blah</li> ...

Would "endless scroll" work with things that are editable?

I'm working on this application that's sort of like a blog. I'm thinking about doing a thing where the user can scroll through all their posts using an "endless scroll" functionality like Google Reader has. Here's the problem I'm anticipating... if the user clicks on a post to edit it, that will take him/her to a new page. Soon enough t...

handling history/change tracking in the DB and consequences on the BL

hi in the current application im working on the client requested that we will save history of every action that happended in the system and provide the ability to backtrack to the previous state of the information. for example: lets say that my app need to handle a storage-room and each user can add/update/delete/read (all CRUD) the inv...

Table design for saving data based on user choices...

Suppose that we have a table for saving human-being data (Human Table) The human table has a column named "relatives" in order to save what type of relatives the human is supporting. The relatives column can have 2 values: 1: means that "close relative" 2: means that "far relative" Now, imagine that user can select one choice between cl...

why my separation of concerns Database/Business objects/Web service, makes me write more code ?

I've read a lot of books on software design, and more and more I'm wondering if what I learned about separation of concern between business object and serialization makes me more productive. I'm influenced by Domain Driven Design, so when I design my business classes I don't think about persistance. The only objects who are coupled to m...

How to make iPhone app look right when user is on a phone call or Internet tethering?

The status bar has grown, so parts of my interface get cut off. Any pointers on how to fix this (e.g. using autoresize masks, etc.)? I use Interface Builder for the UI, so everything is .xib's. ...

Separate controller for home/index site in cakephp? Best Practice?

Hi, I´m starting to developing with cake php. I have designed a DB model and baked my mvc´s. Now i want a index / home site. This site should be an overview of possible actions which a user can do. Should I use an app_controller for that or route to an existing controller even if that controller has nothing to do with a home site, or ...

Java EE example project

Hello! I am currently in the process of learing about Java EE, EJB3 and . So far I am running a JBoss application server and a Oracle database. I have written a stateful session bean which retrieves data from the database through JPA entities. My goal is to have a simple client speaking to a server by calling methods in a stateful bea...

Why use a public property instead of a function to expose a custom collection<T>

During a code review I looked at set of repository classes (in vb.net). I am used to seeing these repository classes full of functions that return collections (among other things) of your domain objects. However, this repository had 1 public property and 1 private variable that looked something like this: Private _item as Collection (of...

What factors exist to choose to develop a website or to use a CMS?

Hello SO Team: We are in the process of starting a new company website and the question was brought to use or not a Content Management Solution. What will be the factors to consider to be able to debate between this two options. Both of them have pros/cons, but I am sure that there has to be a few people out there that will have an ex...

Method has to be overriden but isn't abstract?

I want to implement a function in the base class but I also want it to be overridden in the derived classes everytime. So it is more like "abstract function but with a body". What am I looking for? Am I looking for the right thing? ...

Design question: pass the fields you use or pass the object?

I often see two conflicting strategies for method interfaces, loosely summarized as follows: // Form 1: Pass in an object. double calculateTaxesOwed(TaxForm f) { ... } // Form 2: Pass in the fields you'll use. double calculateTaxesOwed(double taxRate, double income) { ... } // use of form 1: TaxForm f = ... double payment = calculateT...

Auto-update a Windows Service

I am about to develop a program which will be installed and run as a Windows Service on the back-end servers (with internet access) of several clients. I do not have physical access to the servers. What I am working on is a scheme for reliably rolling out updates to the program. I have spend quite a lot of time looking for best practice...

When might multiple inheritance be the only reasonable solution?

To be clear, I'm not asking if/why multiple inheritance is good or bad. I've heard a lot of arguments from both sides of that debate. I'm wondering if there is any kind of design problem or scenario in C++ in which multiple inheritance is either the only way to accomplish something, or at least is the most optimal way over all other alt...