design-patterns

More than 1 facade class in 'facade design pattern' ?

Hi all, Is it acceptable to make more than 1 facade class (not instance) in a facade design pattern? I mean, is it formally forbidden ? Will it inhibit the 'facade design pattern' advantage itself? ...

Pattern for null settings

Hi, I would like to hear your thoughts and ideas about this one. in my application i have controls that are binded to objects properties. but.. the controls always looks like that: a check box, label that explain the settings and then the edited control (for ex: text box) when unchecking the checkbox i disable the text box (using bind...

How do you make a Swing/JFace/SWT GUI addressable?

I have a "fat" GUI that it getting fairly complex, and I would like to add links from a place to an other, and add back/forward buttons to ease navigation. It seems to me that this would be easier if my application was addressable: each composite could have its URI, and links would use that URI. Are there design patterns applicable to t...

Advantages of using delegates?

I'm looking to implement the Observer pattern in VB.NET or C# or some other first-class .NET language. I've heard that delegates can be used for this, but can't figure out why they would be preferred over plain old interfaces implemented on observers. So, Why should I use delegates instead of defining my own interfaces and passing arou...

Creating an extensive project to be sold

Howdy, I am going to start a C# project from scratch that will consist of several modules so it can be sold by modules of an existing PHP/ASP/MySQL/Oracle/MS SQL application that manages to show 3D objects and create 2D and 3D CAD files from a web app that the user can use to create all the stuff. My question is, to start from ground z...

Looking for a design pattern to replace huuuge if on object Type

OK so I'm looking a some code which looks roughly like this: void DoSomething(object o) { if (o is Sometype1) { //cast o to Sometype and do something to it } else if (o is Sometype2) { //cast o to Sometype2 and do something to it } ... else if (o is SometypeN) { //cast o to SometypeN and do something...

Accessing parent elements in an object model efficiently

I have a following object model: - Book -- Chapter 1 --- Page 1 ---- Image 1 ---- Image 2 ---- Text 1 --- Page 2 ... Resources are way down at the page level. But, I need to know the full path to resources, from the resources' point of view. One way, is to have resources be aware of their parents. So my Image object could have...

MVC vs. Observer Pattern

I've recently asked a question on StackoverFlow about the MVC: Can the MVC Design Pattern / Architectural pattern be used in Desktop Application Development? Based on the answer provided I started research on how this would be implemented in a Windows form Application. I came upon the following CodeProject article: http://www.codeprojec...

When and why should I consider asp.net MVC?

I've noticed a lot of talk about asp.net MVC lately, but I haven't come across a clear or compelling description of when, where or why I would want to use it over WebForms. Let's say I wanted to build a small web application that allows a person to advertise some items online. The website will have 4 use cases: Search adverts View l...

Do you use Template Method Pattern in programming languages with closures/delegates/function pointers ?

I have been going back and forth between C# and Java for the last 8 years. One thing that strikes me is that I have completely stopped using the "Template Method" design pattern in C#. Actually, in C# I Have come to think of this pattern as an anti-pattern. http://en.wikipedia.org/wiki/Template_method_pattern Coming back to Java, I ...

Appreciating design patterns

I have been taught design patterns, I have used them at work, but... they have not resulted in better communication. none of us in our team (all adept users) really appreciate design patterns. (we know the textbook "why") What are your experiences in using design patterns in your organization? ...

SOAP Webservice error - design practice

I need to design a SOAP api (my first one!). What are the best practices regarding errors returned to the caller. Assuming an api as follow [WebMethod] public List<someClass> GetList(String param1) { } Should I Throw an exception. Let the SOAP infrastructure generate a SOAP fault -- and the caller would have to try/catch. This is n...

Content Delivery Network algorithms, examples, code

What design considerations must be taken when writing software for content-distribution systems, such as managing the synchronisation and distribution of data, redirecting downloads to the nearest servers and so on? I am also looking for examples of open source CDN (content delivery network) software. I can think of two projects, CoralC...

What database schema can I use to save different types of billing data?

I have a system that creates an order and that order can be billed to a house account, sent Cash on Delivery (COD), or charged to a credit card. I've created the following tables: ORDERS order_id billingoption_id BILLINGOPTIONS billingoption_id I'm unsure of how the next table should be built for the billing data. Should I build a s...

How would you design a docking library for WPF?

I want to implement a docking library in wpf with behavior similar to Adobe Photoshops CS3. You can attach floating Panels to other Panels or Docks by mouse dragging. Docks have a fixed location. Would you use a central Docking Manager class? How would the message flow look like? I was thinking of using 2 interfaces, called IDock and I...

signals and slots

Can someone explain in simple terms the "signals and slots" pattern? ...

Internal global property..bad smell?

I have run into a bit of a desgin issue with some code that I have been working on: My code basic looks like this: Main COM wrapper: public class MapinfoWrapper { public MapinfoWrapper() { Publics.InternalMapinfo = new MapinfoWrapper(); } public void Do(string cmd) { //Call COM do command } ...

How to study design patterns?

I have read around 4-5 books on design patterns, but still I dont feel I have come closer to intermediate level in design patterns? How should I go studying design patterns? Is there any best book for design pattern? I know this will come only with experience but there must be some way to master these? ...

Model-View-Presenter and Modal Dialog boxes.... How to?

I am implementing MVP/M-V-VM in WPF and I'm having good luck with it so far. However, I don't see how this model supports implementing Modal dialog boxes. I've derived my work from Crack.NET (http://www.codeplex.com/cracknetproject) to learn how this stuff works. I have a ShellView view (which is just XAML) that has a menu on it. The...

why not partial class to build the ViewModel in MVVM pattern?

Why not use partial class to build the ViewModel? Since the definition of viewmodel classes have some definition of the data classes of datamodel, why not try to reduce some work, extending or making partial classes of the datamodel, completing them with command and etc. ...