design

UML relation between usecases (extend/include)

Hi, I do not understand well following topic since it is a bit ambiguous from what I read: Inlcude is like a reference to next part, the usecase is not completed without it. This part should be referenced from more places otherwise its use has no sense. But I have seen an example when there is "include" only in some IF statement is t...

Question about UML extend/include from Book Example

Hi, Reading the book about UML, I do not understand following: --------include---> Add new manufacturer Servoce Assistant---Add new product <--------extend----Add new product type I just do not understand it. If there is yet uknown manufacturer, it uses i...

Is returning null after exception is caught bad design

Hello, I always come across the same problem that when an exception is caught in a function that has a non-void return value I don't know what to return. The following code snippet illustrates my problem. public Object getObject(){ try{ ... return object; } catch(Exception e){ //I have to return something here but wha...

Why would you make a whole class sealed/final?

I understand the motivation for making individual methods of a class sealed/final, but what purpose does completely prohibiting inheritance from the class serve? While allowing overriding of certain methods can cause bad things to happen, I can't see how allowing inheritance from your class purely to add behavior to it without overridin...

STL-Like range, What could go wrong if I did this?

I am writing (as a self-teaching exercise) a simple STL-Like range. It is an Immutable-Random-Access "container". My range, keeps only the its start element, the the number of elements and the step size(the difference between two consecutive elements): struct range { ... private: value_type m_first_element, m_element_count, m_step; };...

Polymorphic / Plugable PHP Classes

I have a question which is sonewhat more of a design question. I have a class which defines a bunch of functions. However, I want that the behaviour of some functions are changeable during runtime - or at least working like a plugin interface during design time. eg: class MyClass { public function doSomething(); } $obj = new MyClas...

Change Sub Form Based On Selected Option in C# WPF Project

I apologize for the poor title, I don't know how else to explain it. I have an interface like this (sorry can't post an image directly as I'm new). And I want to have the right side display controls based on the tree selection on the left. What's the easiest way to do this in a WPF project? Is there a better way to go about this? Than...

How to securely store a user's OpenID

I'm writing a web application that allows anyone to register (using their OpenID). When a user registers, their OpenID is saved in a MySQL database. My question is: In which format should I be storing a user's OpenID value? If someone were to gain access to my database (I'm planning for the worst case scenario) - would it be an issue t...

Qt plotting application.

Hi All, Currently I'm trying to develop some simple plot prototype and I'm struggling with some kind of white/empty sheet syndrome. I'm back to Qt after 2 years, so I feel quite retarded. My application should: plot and manage custom layers of data plot on custom canvas background manage markers on plot My plan is to use following...

Creating your program design

what tools do you use to create your program design coding it? ...

Implementing chat system with in Web browser

We want to have web based application to track the issues, knowledge management and chat system. Once the user logged in, user can chat with the service engineers. We will be using Ajax for Chat within the browser. But the server-side we are not sure how to implement chat? The chat history must be saved for lateral viewing. When someone...

Container access and allocation through the same operator?

I have created a container for generic, weak-type data which is accessible through the subscript operator. The std::map container allows both data access and element insertion through the operator, whereas std::vector I think doesn't. What is the best (C++ style) way to proceed? Should I allow allocation through the subscript operator ...

Single network - multiple outpus, or multiple networks - single output?

When designing a feed forward neural network with multiple outputs, is there a conceptual difference (other than computational efficency) between having a single network with multiple outputs, and having multiple networks, each having a single output? Although output neurons in the same network don't affect each other "on the fly", they...

Help on implementing how creatures and items interact in a computer role playing game

I am programming a simple role playing game (to learn and for fun) and I'm at the point where I'm trying to come up with a way for game objects to interact with each other. There are two things I am trying to avoid. Creating a gigantic game object that can be anything and do everything Complexity - so I am staying away from a componen...

Finite State Machine : Bad design?

Are Finite State Machines generally considered as bad design in OOP ? I hear that a lot. And, after I had to work on a really old, undocumented piece of C++ making use of it, I tend to agree. It was a pain to debug. what about readability/maintainability concerns? ...

why C# does not provide internal helper for passing property as reference?

This is issue about LANGUAGE DESIGN. Please do not answer to the question until you read entire post! Thank you. With all helpers existing in C# (like lambdas, or automatic properties) it is very odd for me that I cannot pass property by a reference. Let's say I would like to do that: foo(ref my_class.prop); I get error so I write i...

Resources for designing a user interface for use over remote desktop

Does anyone know of any good resources / tips for designing the user interface of an application which will be used extensively over remote desktop / VNC? There are some obvious ones like: Don't use gradients, use solid blocks of color instead as it helps avoid screen refreshes. I'm looking for more advice and tips like this for making...

Error interface in cpp

I am designing a software that has two logical layers, say A and B. Layer B has set of objects (classes). Layer A uses set of APIs exposed by layer B objects for information retrieval. I want to design a generic error interface across layer B objects that can be exposed to layer A. What would be the best way to write a generic error inte...

Transforming an object implicitly

The following code illustrates a pattern I sometimes see, whereby an object is transformed implicitly as it is passed as a parameter across a number of method calls. var o = new MyReferenceType(); DoSomeWorkAndPossiblyModifyO(o); DoYetMoreWorkAndPossiblyFurtherModifyO(o); //now use o... This feels wrong to me (it hardly feels object...

Is there any value in seperating wcf service contracts from your interface definition?

I have an interface ICustomerService: public interface ICustomerService { CustomerList FindAll(); } and a concrete class implementing that interface. Now I need to expose the method over the web using wcf/rest and I've had to change the interface definition to this: [ServiceContract] public interface ICustomerService { [Operati...