I have been doing code for a few years and still feeling that my knowledge still not broad enough to become a professional. I have studied some books related to Design Pattern but I know there are many others.
So could anyone list the one which you think it is good to learn to become a better programmer and more professional?
Programm...
Using Nerd Dinner as an example:
private NerdDinnerDataContext db = new NerdDinnerDataContext();
public IQueryable<Dinner> FindAllDinners()
{
return db.Dinners;
}
Is it not bad practice to directly expose the entity class Dinner here? I think it is better for the repository to return an IDinner.
So my question is, how can I mak...
First thing... I am novice to pattern world, so correct me if wrong anywhere
Scenario:
There are multiple companies providing multiple products of diff size
so there are 3 entities i.e. Companies, Their Product and size of product
I have implement Abstract Pattern on this i.e. so that I will create instance of
IProductFactory interfac...
Hi there,
I have two years worth of PHP experience however I have never worked with design patterns. I have recently been given a task at work that has made me question the wisdom of that decision.
I have been asked to create a system that:
Insert orders into a database. These orders can have a multitude of attributes and control l...
Hello,
I apologize in advance but this will be a long question.
I'm stuck. I am trying to learn unit testing, C#, and design patterns - all at once. (Maybe that's my problem.) As such I am reading the Art of Unit Testing (Osherove), and Clean Code (Martin), and Head First Design Patterns (O'Reilly).
I am just now beginning to unde...
Im struggling to understand the ViewModel part of the MVVM pattern. My current approach is to have a class, with no logic whatsoever (important), except that it implements INotifyPropertyChanged. The class is just a collection of properties, a struct if you like, describing an as small part of the data as possible. I consider this my Mod...
I'm going to write an application with the Air/Flex-Framework. I'm looking for Best Practise and general Design Patterns for designing software especially in Air/Flex.
I have experience with this framework but never had the pleasure to write a piece of software from scratch.
For instance:
I stumbled across lots of software written in ...
In general, what would make your program more maintainable?
I know a lot of folks that make heavy use of Singletons, but that seems like a cop-out, which creates a kind of global junk drawer organization.
...
I'm looking for a pattern (or good practice) for the following scenario:
My function List<BatchItemResponse> Process(List<BatchItem> Data) {..} will process a list of data, and return info on where each item in the batch could be processed.
struct BatchItemResponse { int BatchItemID; bool Processed; string Description; }
Any thoughts...
Suppose you have this class:
public class A
{
private int number;
public setNumber(int n){
number = n;
}
}
I'd like the method setNumber could be called only by objects of a specific class.
Does it make sense? I know it is not possible, is it? Which are the design alternatives?
Some well known design pattern?
So...
Given a namespaces ns used in two different files:
abc.js
ns = ns || (function () {
foo = function() { ... };
return {
abc : foo
};
}());
def.js
// is this correct?
ns = ns || {}
ns.def = ns.def || (function () {
defoo = function () { ... };
return {
deFoo: defoo
};
}());
Is this the proper way to a...
Hi, I am building an bugtracking application where I am thinkining of taking maximum possible benefits of OOPS starting from my presentation layer to my data access layer. The architecture will be as usual 3-tier but I want to use Design Patterns or simply OOPS to create connection pull out data or something like that.
...
I've been reading both definitions and they seem quite the same. Could anyone point out what are their differences?
Thanks
...
Hello,
I want to create a class that can use one of four algorithms (and the algorithm to use is only known at run-time). I was thinking that the Strategy design pattern sounds appropriate, but my problem is that each algorithm requires slightly different parameters. Would it be a bad design to use strategy, but pass in the relevant par...
What is the idea behind Grasp's Controller pattern?
My current interpretation is that sometimes you want to achieve something that needs to use a couple of classes but none of those classes could or has access to the information needed to do it, so you create a new class that does the job, having references to all the needed classes(thi...
In our system, we have a number of classes whose construction must happen asynchronously. We wrap the construction process in another class that derives from an IConstructor class:
class IConstructor {
public:
virtual void Update() = 0;
virtual Status GetStatus() = 0;
virtual int GetLastError() = 0;
};
Ther...
I have a search form that can search in different provider.
I started out by having a base controller
public SearchController : Controller
{
protected readonly ISearchService _searchService
public SearchController(ISearchService searchService)
{
_searchService= searchService;
}
public ActionResult Search(....
Assuming the parameters are all the same type, is there a rule of thumb in regards to the number of parameters for a method? Im just wondering where I should draw the line and what my alternatives are (ie interface, array, etc).
...
With alle the new paralell programming features in .NET 4.0, what would be a a simple and fast way to implement the producer-consumer pattern (where at least one thread is producing/enqueuing task items and another thread executes/dequeues these tasks). Can we benfit from all these new APIs? What is your preferred implementation of this ...
I have a bunch of methods with varying signatures. These methods interact with a fragile data connection, so we often use a helper class to perform retries/reconnects, etc. Like so:
MyHelper.PerformCall( () => { doStuffWithData(parameters...) });
And this works fine, but it can make the code a little cluttery. What I would prefer t...