How to keep receiving events even with changed references?
In a project I have the following relation between BO and GUI
By e.g. G could represent a graphic with time lines, C a TimeLine curve, P - points of that curve and T the time that represents each point.
Each GUI object is associated with the BO corresponding object.
When T ch...
Hi there:
I just want to inject some design patterns into my Java code, but I don't know which style to use -- is inheritance or interface preferred? And why?
Thanks!
Kind regards!
...
We are using ASP.NET with a lot of AJAX "Page Method" calls.
The WebServices defined in the Page invokes methods from our BusinessLayer.
To prevent hackers to call the Page Methods, we want to implement some security in the BusinessLayer.
We are struggling with two different issues.
First one:
public List<Employees> GetAllEmployees()...
Someone recently asked a question about the Ghost Design Pattern - I have not seen this before.
What is the Ghost Design Pattern and how is it implemented? I can only find snippets on the web in reference to it.
...
I am writing a simple prototype code to demonstrate & profile I/O schemes (HDF4, HDF5, HDF5 using parallel IO, NetCDF, etc.) for a physics code. Since focus is on IO, the rest of the program is very simple:
class Grid
{
public:
floatArray x,y,z;
};
class MyModel
{
public:
MyModel(const int &nip1, const int &njp1, const int &nkp1,...
Here's briefly what I'm trying to do.
The user supplies me with a link to a photo from one of several photo-sharing websites (such as Flickr, Zooomr, et. al). I then do some processing on the photo using their respective APIs.
Right now, I'm only implementing one service, but I will most likely add more in the near future.
I don't wan...
Having recently done some development for iPhone, I've come to notice an interesting design pattern used a lot in the iPhone SDK, regarding object mutability.
It seems the typical approach there is to define an immutable class NSFoo, and then derive from it a mutable descendant NSMutableFoo. Generally, the NSFoo class defines data membe...
I have an existing database design that stores Job Vacancies.
The "Vacancy" table has a number of fixed fields across all clients, such as "Title", "Description", "Salary range".
There is an EAV design for "Custom" fields that the Clients can setup themselves, such as, "Manager Name", "Working Hours". The field names are stored in a "C...
I have an open source application (here)
This application get a character or a sentence and give some unicode information about it.
Iuse Unicode Character Database which provided by Unicode.org this is a XML document (130MB)
At first I embed this XML to my DLL but I don't know is it a good approach or no. because DLL size growth just ...
I am building a c# - linq - sql server winforms/asp.net application, accessing a database. I would like my business logic layer to be easily testable, and that means not littering it with Linq database queries everywhere. What design patterns/ best practices are available for the following use cases
- inserting/updating a new object
- s...
Hi,
I have a state machine with many states A--B--C--D--E. I have many transitions from C for example to A if some condition is verified. For every state I have a class extending abstract class Stateand I have a manager that delegates every transition method to state method. The question is "could states call directly manager transitio...
I'm looking for an application developed in C# with following qualities, which is available as source code.
Based on OO Architecture
Must connect to DB.
Must handle atleast a "one to many master child" relationship (eg: Order and items ordered)
Should display the data using Datagrid or other similar controls.
Reports (either with repor...
How does undo work? Does it copy all the managed objects every time any of the values change? Or does it only copy the actual changes together with an information which objects were affected? Is that heavy or lightweight?
...
I know there are jQuery cookie plugins out there, but I wanted to write one for the sake of better learning the jQuery plugin pattern.
I like the separation of "work" in small, manageable functions, but I feel like I'm passing name, value, and options arguments around too much. Is there a way this can be refactored?
I'm looking for sni...
Here is a simple thread pattern that I use when writing a class that needs just one thread, and needs to a specific task.
The usual requirements for such a class are that it should be startable, stopable and restartable. Does anyone see any issues with this pattern that I use?
public class MyThread implements Runnable {
private boo...
The approach i always had in programming a winforms or wpf application to perform queries on a database is the following:
Design an interface with several controls to pass parameters to my query classes
Build a "DataAccess" class with fields, properties and methods for the queries, based on Linq or Entity Framework as data source.
Mana...
I posted a question about a thread pattern today, and almost everyone suggested that I look into the ExecutorService.
While I was looking into the ExecutorService, I think I am missing something. What happens if the service has a running or blocked threads, and someone calls ExecutorService.shutdown(). What happens to threads that are r...
Hello,
I have a recursive function being used to generate a menu on my site. The function is calling a database for each level of children in the menu, and generating html for them.
I've currently put this function in a Model part of the code, however, I feel that generating html in the model goes against the MVC.
I didn't put it in a...
Creating custom Zend View helpers I often end up with something like:
// logic here
if ($condition) {
$output = <<<EOS...
} else {
$output = <<<EOS...
}
or using switch.
Then to eliminate this, I create setPartial(), getPartial() and htmlize() for using external .phtml's.
This is not the best solution, because partials do no...
Hello All,
It's regarding Abstract Factory pattern.
As we know that there are 2 ways we can use i.e.
Either create the instance of concrete class directly or
Provide an interface by which we can access concrete class
Can someone tell the advantage/dis-advantages that if I use option 1 then these are issues that can occur or vice-ve...