design

How to apply Composite-Iterator

I'm trying to figure out how can i merge iterator and composite objects. what can be the best implementation for a struct below. class Composite<Item> : Item { } class Iterator<Item> { } class Iterable<Item> { } ...

Where and how to use nested classes ?

Hello everybody I am thinking that if a class will be instantiated only in another class so it is right to use it nested in that class.I think this will help us good design.When i look at my project i have almost never seen such nested structure.But if i try to nested classes so this time another questions appear in my mind.For example ...

A good way to have all my messages in Java

Hello, i'm looking for a small framework to have all my messages stored in a common way. I'll give an example for better understanding. In a part of my code, in a particular JFrame i've an alert something like this: JOptionPane.showMessageDialog(null, "Error, you must provide an integer value", "ERROR", JOptionPane.ERROR_MESSAGE); S...

what design pattern to use for multiple throttled api requests?

I'm writing a web site that uses multiple web services with throttle restrictions. I.e. Amazon is 1 request per second, another is 5000/day another is x/minute. When a user does something, I need to trigger one or more requests to the above services and return the results (to the browser) when available. The solution need to be flexibl...

what is the difference between functional specification & High/Low level Design

I have gone through the topics Functional Specification, High Level Design, Low Level Design. I read their description & template from different sites. I know the difference between High Level Design & Low Level Design. Both the functional specification & Hign/Low level design provides the guide for coding the programmer, both describes ...

how can i set the video's height and width to fill the colorbox ?

hi; the video is shown in a colorbox.But this doesn't fill the colorbox.How can i solve the problem?here is the colorbox code. $(".aHelpSource").colorbox({ iframe: true, innerWidth: 700, innerHeight: 400 }); here is the code which for the video. "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' width='150%' height='150%...

Which are the points the Low Level Template should contain?

I am searching for Low Level Template. I have the template for Functional Specification & High Level Design. I grab it by searching on the internet. I am searching for the Low Level Design Template but unable to get the detailed template or can anybody tell me at-least which are points the Low Level Template should contain ?. Please prov...

ViewController design question for complex layout

I'm building my second app, and I'm trying to learn from the places I stubbed my toes on the first one. Just as in the last app, I have sections of my app that feature a view with buttons along the bottom (basically a custom tab bar) that trigger the switching of the contents of the main, big area of the screen. One is a map view, one i...

Enumerating Structs and Classes for Properties at Design Time

How can I write my own structs which can be used as a property during design time? I need to be able to specify a default value, and have a selectable list of pre-defined structs for the designer to pick from, in much the same way as Color properties are implemented. Furthermore, how can I do this with classes, like Font does? How can y...

Why are heaps in c++ implemented as algorithms instead of containers?

I was wondering why the heap concept is implemented as algorithms (make_heap, pop_heap, push_heap, sort_heap) instead of a container. I am especially interested is some one's solution can also explain why set and map are containers instead of similar collections of algorithms (make_set add_set rm_set etc). ...

Why isn't this thread reading all data from the pipe consistently?

Anything wrong with this in general? CallingFunction() { CreatePipe() CreateMutex() CreateThread( ThreadFunction ) while(there is data left to send) { WriteFile(send data in 256 byte chunks) } WaitForSingleobject() //don't return until ReadThread is done return 0; } ThreadFunction() { WaitForSinglOb...

How to generate a printed form with dynamic inputs

Our customer would like to give participation certificates for students undergoing a singing class. Currently they have printed certificates where in they fill the candidate name and the grade he obtained with the teachers signature. We would like to automate this, so that the dynamic output mentioned above is automatically printed some...

How to encapsulate private fields that only apply to a few methods

I'm working on modeling a business domain object in a class and am wondering what would be the best way to properly encapsulate private fields that only apply to a few methods. When I started, my code originally looked like this: public class DiscountEngine { public Cart As Cart { get; set;} public Discount As Discount { get; s...

I'm about to get my first gig doing web design work, what should I know?

I'm about to get a job doing some basic design work for a client I've worked with before. I have freelanced before, but generally, I deal with desktop applications or embedded work; this is my first time doing a web project. What is some advice, specific to my situation, that would help me? I've been reading Clients From Hell and I'm a...

Need inspiration for naming classes and methods.

Possible Duplicates: Anyone else find naming classes and methods one of the most difficult part in programming? Whats the best approach to naming classes? Finding appropriate abstraction names can sometime be time-consuming, especially if your mother tongue is not english. I was wondering if there exists somewhere some sort...

Design pattern for creating object from file?

Hi, I am creating a software project in which most business objects are stored in files (in a legacy format). The objects will only be instantiated from an inputstream. I do this today with making the constructor private and instantiating in a static function as follows: public class BusinessObject { private BusinessObject() {} ...

Defining an interface which is blank and its implications

I recently came across the situation where I wanted a set of classes to be passed into a method (so that method took an interface as a parameter). However, the classes under the interface each had a different number of methods, so the interface itself was blank. What, if anything, does this say about the design of my application? I was...

IE doesn't display properly the same code on the same page twice

Okey, here it goes. I have a block of code that repeats it self twice. But it doesn't display the same, it is on the same page. I've checked everything is the same the html and the CSS. I realy can't wrap my head around this. This code is part of joomla module. I have to note that this is not my code!!! But i have to fix it so.. <di...

Java Swing: keeping the event handling maintanable

In my current project we are using for our Swing client the following patterns: Business Object (POJO) <--> (mapping) <--> Presentation Model (POJO with property change support) <--> (binding) <--> view components Everything is fine and works the way we are expecting them to behave. BUT, we encouter those problems when view begin to ...

Inform client application or arrange internal state first?

Let's say we have a client application that uses a network stack. The stack detects an error condition that leads the stack to close it's connection and raises a ConnectionStateChanged event. Besides that the stack raises an ErrorOccured event to inform the client appplication about the error condition. So what to do first? Arrange the ...