patterns

What are MVP and MVC and what is the difference?

When looking beyond the RAD (drag-drop and configure) way of building User Interfaces that many tools encourage you are likely to come across 2 design patterns called Model-View-Controller and Model-View-Presenter. My question has two parts to it: What issues do these patterns address? How are they similar? How are they different?...

What is Inversion of Control?

Inversion of Control (or IoC) can be quite confusing when it is first encountered. What is it? What problems does it solve? When is it appropriate and when not?...

Repository pattern tutorial in C#

Can anyone recommend good tutorial on repository pattern usage, in C#?...

MVC pattern question: Who has what? who calls what?

I am refactoring a project and I want to make it conform to the MVC pattern (model view control). There are three objects: a ServerList (maintains a list of servers that are active) - this guy will be the controller a Form - this is your standard .NET GUI a DatabaseThingy - wrapper class that reads/writes to database. (don't ask me wh...

Need Pattern for dynamic search of multiple sql tables

I'm looking for a pattern for performing a dynamic search on multiple tables. I have no control over the legacy (and poorly designed) database table structure. Consider a scenario similar to a resume search where a user may want to perform a search against any of the data in the resume and get back a list of resumes that match their se...

Looking for example of Command pattern for UI

I'm working on a WinForm .Net application with the basic UI that includes toolbar buttons, menu items and keystrokes that all initiate the same underlying code. Right now the event handlers for each of these call a common method to perform the function. From what I've read this type of action could be handled by the Command design patte...

Agile architectures

Hello all, I am starting my graduate thesis and the subject will be "agile architectures" Basically, it will start with a description of traditional software development methologies, and the subsequent birth of agile methodologies, finishing with recommendations and a design of a flexible application architecture easily adaptable to the...

Use a LIKE clause in part of an INNER JOIN

Can/Should I use a LIKE criteria as part of an INNER JOIN when building a stored procedure/query? I'm not sure I'm asking the right thing, so let me explain. I'm creating a procedure that is going to take a list of keywords to be searched for in a column that contains text. If I was sitting at the console, I'd execute it as such: SELEC...

Compact Framework - Is there an MVC framework/library available?

I've found an article on this subject by a Microsoft employee, but has anyone implemented a more robust framework for this? Is there a lightweight framework for WinForms that could be ported easily? I'd like to get up to speed fairly quickly and avoid producing a framework/library of my own to handle this when someone smarter has already...

How to represent cross-model information in MVC?

I have an application, built using MVC, that produces a view which delivers summary information across a number of models. Further to that, some calculations are performed across the different sets of data. There's no clear single model (that maps to a table at least) that seems to make sense as the starting point for this, so the vario...

What is the regex pattern for datetime (2008-09-01 12:35:45 ) ?

Dont have any additional information. Just what is the regex pattern for datetime (2008-09-01 12:35:45 ) ? @Espo : I get this error : No ending delimiter '^' found using: preg_match('(?n:^(?=\d)((?31(?!(.0?[2469]|11))|30(?!.0?2)|29(?(.0?2)(?=.{3,4}(1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|(16|[2468][048]|[3579][26])00))|0?[1-9]|...

Should I Keep Registering A Failure?

Hi all, I'm working on an automated regression test suite for an app which I maintain. While developing the automated regression test, I ran across some behavior that's almost certainly a bug. So, for now, I've modified the automated regression test to not register a failure--it's deliberately allowing this bad behavior to go by, I me...

Patterns for the overlap of two objects

I'm sure this has already been asked and answered so I apologize in advance for that but I'm not figuring out the correct keywords to search for. Searching for "Pattern" hits way too many Q & A's to be useful. I'm working on a regression testing app. I'm displaying a form on the screen and according to which user is logged in to the a...

Activator.CreateInstance(string) and Activator.CreateInstance<T>() difference

No, this is not a question about generics. I have a Factory pattern with several classes with internal constructors (I don't want them being instantiated if not through the factory). My problem is that CreateInstance fails with a "No parameterless constructor defined for this object" error unless I pass "true" on the non-public paramet...

C++ Quiz - Singletons

I'll soon be posting an article on my blog, but I'd like to verify I haven't missed anything first. Find an example I've missed, and I'll cite you on my post... The topic is failed Singleton implementations - in what cases can you accidentally get multiple instances of a singleton? So far, I've come up with Race Condition on first ca...

Efficient way to implement singleton pattern in Java

Efficient way to implement singleton pattern in Java? ...

What are the advantages and disadvantages of the Session Façade Core J2EE Pattern?

What are the advantages and disadvantages of the Session Façade Core J2EE Pattern? What are the assumptions behind it? Are these assumptions valid in a particular environment? ...

Lua Patterns,Tips and Tricks

This is a Tips & Tricks question with the purpose of letting people accumulate their patterns, tips and tricks for Lua. Lua is a great scripting language, however there is a lack of documented patterns, and I'm sure everyone has their favorites, so newcomers and people wondering if they should use it or not can actually appreciate the ...

Word frequency algorithm for natural language processing

Without getting a degree in information retrieval, I'd like to know if there exists any algorithms for counting the frequency that words occur in a given body of text. The goal is to get a "general feel" of what people are saying over a set of textual comments. Along the lines of Wordle. What I'd like: ignore articles, pronouns, etc...

Caching Data Objects when using Repository/Service Pattern and MVC

I have an MVC-based site, which is using a Repository/Service pattern for data access. The Services are written to be using in a majority of applications (console, winform, and web). Currently, the controllers communicate directly to the services. This has limited the ability to apply proper caching. I see my options as the following...