Domain Driven Design in Functional Programming?
It may sound like a stupid idea but I was just wondering if there is an equivalent of DDD in FP? It seems to me that DDD is only valid in OOP paradigm. Thanks. ...
It may sound like a stupid idea but I was just wondering if there is an equivalent of DDD in FP? It seems to me that DDD is only valid in OOP paradigm. Thanks. ...
So, coming upon the subject of Factories, I'm wondering how they are set up. From where I stand, I can see 3 types of Factories: All In One A factory that basically contains all of the classes used in an application. It feels like it is just having a factory for the sake of having a factory, and doesn't really feel structured. Exampl...
Can anybody explain me the concept of virtual destructor ? and also how it is taken care in dotnet ? ...
I am trying to write a graphics application in C++. It currently uses OGRE for display, but I'd like it to work with Irrlicht or any other engine, even a custom rendering engine which supports my needs. This is a rather long question, so I'd appreciate help on re-tagging/ cleanup (if necessary). I'll start with a little background. ...
How can I do this in OO PHP: A form ('in newstudent.php') asks the user to enter his name, course and year. After selecting 'Submit' button, the page will go to 'records.php' records.php - contains a table that displays all the records (columns: name, course, year) when the user selects 'Submit', the new record will be added to the dat...
I am working on a C# application which consists of objects Department, Course, and Section. Each Department has many Courses, and each Course has many Sections. Currently I have three classes: Department, Course, and Section. Department contains some properties and then a List Courses, which contains the courses the department offers....
I'm new to OO PHP and I have read that using Frameworks can really help me with my projects. Can anyone suggest a site where I can learn how to start with CakePHP or tell me what I need to do so that I could use the framework CakePHP? I have no idea X.x Thanks ...
I have method List<Foo> getFoos () which gets the data from remote server and returns it. Of course, user shouldn't change number of items of the list because he'll get data not synchronized with data on the server (and if he want change number of items he has special methods like addFoo ()). First approach was to return array and cha...
I don't remember exactly is it a common pattern but I have a class (Factory Method pattern) which has method for creating other classes (Abstract Factory pattern) depending on enum parameter: public class FooFactoryFactory { public FooFactory createFactory (FooFactoryType type) { switch (type) { case AFoo: ...
Been tasked to write some asset tracking software... Want to try to do this the right way. So I thought that a lot of assets had common fields. For instance, a computer has a model and a manufacturer which a mobile phone also has. I would want to store computers, monitors, mobile phones, etc. So I thought the common stuff can be taken...
I'm working on an object that at some point instantiates another object. That inner object might throw an exception. I could just let that exception bubble up to whatever code is handling the parent object, which is what I want to do, following the philosophy of KISS. Or, I could do some exception handling within the parent object, and p...
Consider the following code: class A { B* b; // an A object owns a B object A() : b(NULL) { } // we don't know what b will be when constructing A void calledVeryOften(…) { if (b) delete b; b = new B(param1, param2, param3, param4); } }; My goal: I need to maximize performance, which, ...
I am creating a custom MaskedTextBox for Date only. Now i want to hide Mask property of MaskedTextBox from its users. EDIT: public class CustomDateMask:System.Windows.Forms.MaskedTextBox { public new string Mask { get; private set; } public CustomDateMask() { ...
I am creating a custom control and i want to add some properties in it. On few of the properties i want to create some events. Say if i have a property public int Date {get; set;} now if its value is changing i want to trigger a change event. SO how can i add event on this ...
The following code illustrates a pattern I sometimes see, whereby an object is transformed implicitly as it is passed as a parameter across a number of method calls. var o = new MyReferenceType(); DoSomeWorkAndPossiblyModifyO(o); DoYetMoreWorkAndPossiblyFurtherModifyO(o); //now use o... This feels wrong to me (it hardly feels object...
I have a small question regarding design patterns I have this 2 classes which extend from the very same class (doctrine_record) so they mainly have the very same methods and functions however, they now have different attributes. I'd like to create a wrapper that exposes the 2 classes summed attributes, I remember there was a pattern fo...
Hay Dear! First of all have a look at the following code (in this code shape is the base class and line is the derived class) void drawshapes(shape sarray[],int size) { for(int i=0;i< size; i++) sarray[i].draw(); } main() { line larray[10]; larray[0]=line(p1,p2);//assuming that we have a point class larray[1]=line(p2,p...
I wrote this simple Munin plugin to graph average fan speed and I want to redo it to OOP - strictly as a learning exercise. Don't have a clue where to start though. Anyone feel like offering some guidance or even an example of what this script should look like when done. I will use it to redo some other scripts into an OOP style as well;...
There were some questions that got answers with books specifically, but I wonder if there are any other non-book good resources (pages, blogs, online tutorials) to learn design patterns. ...
To show an example what is this question about: I have currently a dilemma in PHP project I'm working on. I have in mind a method that will be used by multiple classes (UIs in this case - MVC model), but I'm not sure how to represent such methods in OO design. The first thing that came into my mind was to create a class with static func...