design-patterns

Chunky interface meaning

In the book of application architecture design, which I'am reading, I've found the following statement: "To reduce round trips and improve communication performance, design chunky interfaces." Can anybody explain me what does "chunky interface" mean? ...

Looking for advice for implementing a versioning feature in our application.

I am starting a project to create an "object versioning" feature for our software (.NET 3.5 / SQL Server 2008), basically it needs to do this: a user is looking at a customer: last name is "Smith-Johnson" 2 addresses (saved in different table) 1 product purchased 1 employee contact (saved in different table) 200 mails (saved in differ...

a design problem with relatively complicated validations

hi, i have a design problem.. it may seem that i'm giving you too much details, but those are important. say i have a very large input form, with a complicated input, that requires quiet complicated validations, includes validations of relations between different inputs. being probably a very burdensome form for the user, i'd like to g...

Optimising and Redesigning an existing Application

This seems to be a popular complaint on many programmer forums so I wouldn't be surprised if this question was already on here. Sorry if it has already been answered but I've searched and couldn't find one that relates to Java/OO. I have a somewhat complicated application that was written a number of months ago. It works well, but is sl...

where to put the validate logic? In Service or Repository?

I have some logic like this, before save the stock into the db, i will check whether there is stock has the same stock code in the database. My question is where should I put the logic, in the service layer or repository layer. here is the sample code: option 1: put in the service layer, i put the IsAccountAlreadyExists Method in the ser...

Raise Events in .NET on the main UI thread

I'm developing a class library in .NET that other developers will consume eventually. This library makes use of a few worker threads, and those threads fire status events that will cause some UI controls to be updated in the WinForms / WPF application. Normally, for every update, you would need to check the .InvokeRequired property on W...

Pattern to implement a toolbox in .Net/Wpf (not the visual part)?

I'm building a Wpf app that currently has a toolbox which looks and functions similarly to the Visual Studio toolbox. I have a range of classes that are represented in the toolbox and different types of objects that can each contain some, but not all, of the toolbox items. As a stopgap measure to get my app up and going, I hardcoded the...

The Three ROME Object Models Design Pattern

I have been reading about the three ROME object models which goes like this SyndFeed(Model) <-- conversion --> RSS(Wire Feed Model) SyndFeed(Model) <-- conversion --> Atom(Wire Feed Model) I came to the conclusion that this model wouldn't actually meet my application needs but I still like this pattern however I can't figure out whic...

How does a WCF server inform a WCF client about changes? (Better solution then simple polling, e.g. Comet or long polling)

see also "WCF push to client through firewall" I need to have a WCF client that connect to a WCF server, then when some of the data changes on the server the clients need to update its display. As there is likely to be a firewall between the clients and the server. All communications must be over HTTP The server can not make an...

Simple C++ logger by using singleton pattern

Due to the flooding examples of implementing logger using Singleton pattern, I just written a simple C++ logger in the same approach for my program. However, since the famous double-checked locking approach is known to be no more thread-safe, I wonder if I should: 1) Forget about the use of Singleton pattern in this case? 2) Continue t...

How not to create presenter object in view?

I'm currently trying out some MVP patterns sample and I have been told not create concrete Presenter objects in the View. Is there any way to have Presenter objects created dynamically ? public partial class View: Window, IView { private Presenter _presenter; public View() { InitializeComponent(); _presente...

Organizing classes using the repository design pattern

I have started upgrading one of our internal software applications, written in ASP.NET Web Forms, and moving to ASP.NET MVC. I am trying to leverage the Repository design pattern for my classes, which leads me to my question about how much to put into a repository. I have the following entities: Topic Topic Comments (Topic can have...

Design pattern for managing queues and stacks?

Is there a design pattern for managing a queue or a stack? For example, we are looking to manage a list of tasks. These tasks will be added to a group queue, users will then be able to pull off the queue and add them to their personal queue. ...

What's the best pattern to handle a table row datastructure?

The Facts I have the following datastructure consisting of a table and a list of attributes (simplified): class Table { List<Attribute> m_attributes; } abstract class Attribute {} class LongAttribute extends Attribute {} class StringAttribute extends Attribute {} class DateAttribute extends Attribute {} ... Now I want to do dif...

what is best place to register proxy and mediator in flex puremvc framework?

I am using puremvc framework for developing flex based project. My question is related to what is best way to delayed registering proxy class and mediator class ? Currently on startup command I am registering startup mediator. My code has : ApplicationFacade.as StartupCommand.as StartupMediator.as LoginCommand.as LoginMediator.as Logi...

Any list of Design Patterns possible sorted By "Frequency Of Usage?"

Hi, Is there any list of Design Patterns showing which are the most used ones; let's say sorted by frequency of their usage. I presume if there is such a list available, maybe it can be a kind of guide to know where to start to learn and practice design patterns. Thanks. ...

C++: static function wrapper that routes to member function?

Hi, I've tried all sorts of design approaches to solve this problem, but I just can't seem to get it right. I need to expose some static functions to use as callback function to a C lib. However, I want the actual implementation to be non-static, so I can use virtual functions and reuse code in a base class. Such as: class Callbacks { ...

Repository Pattern: Is it only for database source?

Hello, I was wondering if i can use the Repository Pattern for anything other than a database layer? I have used the pattern for a shopcart where I stored shopcart items in an array in ShopCartRepository class. I then got the data from the ShopCartRepository using a ShopCartController class. As mentioned the ShopCartRepository only de...

Is List<> better than DataSet for UI Layer in ASP.Net ?

I want to get data from my data access layer into my business layer, then prepare it for use in my UI. So i wonder: is it better to read my data by DataReader and use it to fill a List<BLClasses> or to fill a DataSet and send the DataSet to UI Layer ??. I'm interested in good performance and scalability. ...

Is there any reason to avoid the sentinel pattern in Java?

I've heard people advise that one should always use the Iterator pattern to control loops rather than throwing an exception (which is how it's done in Python iterators) or using the Sentinel pattern, whereby a special, sentinel value (often null) is returned to indicate the end of the iteration. Does best practice advise against the se...