Are there any commonly used patterns in Javascript for storing the URL's of endpoints that will be requested in an AJAX application?
For example would you create a "Service" class to abstract the URL's away?
...
Mine is merely (or a close variant thereof):
static MyClass *gInstance = NULL;
+ (MyClass *)instance
{
@synchronized(self)
{
if (gInstance == NULL)
gInstance = [[self alloc] init];
}
return(gInstance);
}
...
Design patterns are usually related to object oriented design.
Are there design patterns for creating and programming relational databases?
Many problems surely must have reusable solutions.
Examples would include patterns for table design, stored procedures, triggers, etc...
Is there an online repository of such patterns, similar to m...
Hi there,
This question is related to (but perhaps not quite the same as):
http://stackoverflow.com/questions/61451/does-django-have-html-helpers
My problem is this: In Django, I am constantly reproducing the basic formatting for low-level database objects. Here's an example:
I have two classes, Person and Address. There are multiple...
I am working with a log of events where there are about 60 different "types" of events. Each event shares about 10 properties, and then there are subcategories of events that share various extra properties.
How I work with these events does depend on their type or what categorical interfaces they implement.
But it seems to be leading t...
I'm working on some code that uses a pattern in its business and data tiers that uses events to signal errors e.g.
resource = AllocateLotsOfMemory();
if (SomeCondition())
{
OnOddError(new OddErrorEventArgs(resource.StatusProperty));
resource.FreeLotsOfMemory();
return;
}
This looked superficially rather odd, espec...
What are some practical uses for the "Curiously Recurring Template Pattern"? The "counted class" example commonly shown just isn't a convincing example to me.
...
The link over here lists ([http://www.yoda.arachsys.com/csharp/singleton.html][1]) some singleton patterns in C#. The article also describes the obvious that a singleton is not meant to accept parameters which “as otherwise a second request for an instance but with a different parameter could be problematic”. This means that any paramete...
Hi,
Originally there was the DAL object which my BO's called for info and then passed to UI. Then I started noticing reduced code in UI and there were Controller classes. What's the decent recomendation.
I currently structure mine
Public Class OrderDAL
Private _id Integer
Private _order as Order
Public Function GetOrder(i...
I'm wondering how (un)common it is to encapsulate an algorithm into a class? More concretely, instead of having a number of separate functions that forward common parameters between each other:
void f(int common1, int param1, int *out1);
void g(int common1, int common2, int param1, int *out2)
{
f(common1, param1, ..);
}
to encapsula...
I realized that OOP is the only area where I can produce results I'm satisfied with. To be more specific - mainstream static-typed OOP like C++,C# or Java. May be it is so because I've read enough books and articles on it and because most of my programming experience is in OOP. And may be because OOP is just really good :)
Each time I h...
I recently finished a book and discussion group about Software Design Patterns.
We have now started to study Integration Patterns.
I am currently reading the free Microsoft Integration Patterns PDF.
It is pretty good thus far, but it is old and I figured that there might be a better option available.
Any recommendations for books, b...
Hi All,
You do you manage the same presenter working with different repositories using the MVP pattern?
I just have multiple constructor overloads and the presenter simply uses the one that is suitable for the scenario.
AddCustomerPresenter presenter = new AddCustomerPresenter(this,customerRepository);
presenter.AddCustomer();
p...
I inherited a database built with the idea that composite keys are much more ideal than using a unique object ID field and that when building a database, a single unique ID should never be used as a primary key. Because I was building a Rails from end for this database, I ran into difficulties getting it to conform to the Rails conventi...
I've organized my code so that the data is organized hierarchically. I find myself crawling up the tree using code like the following:
File clientFolder = task.getActionPlan().getClientFile().getClient().getDocumentsFolder();
Now, since I'm not drilling down into the task object, I'm drilling up to its parents, I don't think I'm loos...
Let's face it. The Singleton Pattern is highly controversial topic with hordes programmers on both sides of the fence. There are those who feel like the Singleton is nothing more then a glorified global variable, and others who swear by pattern and use it incessantly. I don't want the Singleton Controversy to lie at the heart of my qu...
We are build a website using MVC pattern. So far all the pages we built used models which had to operate on Reference data(which is cached when the website loads for the first time).
But now we have reached that stage of the flow where we have to deal with Transactional data (which is specific to that flow). Till now we created model cla...
Are there any good resources (books, authoritative guides, etc.) for design patterns or other best practices for software that includes financial accounting features?
Specifically, where is good information about handling issues like the following:
Internal representations of money quantities
Internal representations of accounts, jour...
I'm considering one of two IRepository interfaces, one that is a descendant of IQueryable and one that contains IQueryable.
Like this:
public interface IRepository<T> : IQueryable<T>
{
T Save(T entity);
void Delete(T entity);
}
Or this:
public interface IRepository<T>
{
T Save(T entity);
void Delete(T entity);
I...
Greetings,
I have been looking for a logging framework for .net (c#) and decided to give log4net a go after reading up on a few question/answer threads here on stackoverflow. I see people mentioning over and over that they use a wrapper class for log4net and I am wonder what that would look like.
I have my code split up into different ...