I am convinced that functional programming is an excellent choice when it comes to applications that require a lot of computation (data mining, AI, nlp etc).
But is it wise to use functional programming for a typical enterprise application where there are a lot of business rules but not much in terms of computation?
Please disregard ...
I've read a couple of articles on immutability but still don't follow the concept very well.
I made a thread on here recently which mentioned immutability, but as this is a topic in itself, I am making a dedicated thread now.
I mentioned in the past thread that I thought immutability is the process of making an object read only and giv...
I'm starting the design of a new app that is primarily network oriented, and I'm looking for some advice from people who have come up with a good architectural design, or OOP class model.
Please describe the basic architecture and/or class structure. Did you abstract out the communication bits? What class entities did you come up with...
If I have a member variable such as this (declared in the body of a class)
private Dot[] dots=new Dot[numDots];
I loop through all members of this array, and:
1) Pass every Dot object to a function of another class, which:
2) Passes it to yet another function of a 3rd class, if some conditions are met
3) And the 3rd class changes s...
Is there a difference between a business object and an entity?
If I were to define a POCO type of class, say a Product class, would that be a business object or an entity?
public class Product {
public int ID { get; set; }
public string Name { get; set; }
public double Price { get; set; }
public string Sku { get; set; }...
Last week I was bitten twice by accidentally overriding methods in a subclass. While I am not a fan of inheritance, we (ab)use this in our application at work. What I would like to do is provide some declarative syntax for stating that a method is overriding a parent method. Something like this:
use Attribute::Override;
use parent '...
Before the introduction to generics to the Java language I would have written classes encapsulating collections-of-collections-of-collections. For example:
class Account {
private Map tradesByRegion; //KEY=Region, VALUE=TradeCollection
}
class TradeCollection {
private Map tradesByInstrument; //KEY=Instrument, Value=Trade
}
Of ...
Do default parameters for methods violate Encapsulation?
What was the rationale behind not providing default parameters in C#?
...
Singleton is definitely one of the most misused and abused patterns out there. Many of us have been infected with Singletonitis at one point or another. Curiously, its close cousin Monostate is less famous and less used. What is your opinion of Monostate? Good or just as evil? Is it a better alternative to using Singleton? Would you a...
I am having some trouble with an idea that at its simplest seems like it should work.
I am trying to overload a Property of Type BindingList<T> in a subclass with a BindingList of <subclasss T>. There are ways I can get around this but it seems the 'nicest' way would be without any direct casting. I have tried a bunch of options and h...
I'm learning the Python programming language, and I've come across certain things I don't fully understand. I'm coming from a C background, but I never went far with that either.
What I'm trying to figure out is:
In a method:
def method(self, blah):
def __init__(?):
....
....
What does self do? what is it meant to b...
hi guys,
i'm currently in the process of modifying a legacy editor application and i need to add in a few data structures which i have made into a class of it's own which i later add to a collection object. but thus far i'm little bit blurry on where to put all of my functions which is related to that object. i'm thinking maybe OO like d...
I am trying to figure out recursion for OCaml in the context of an object's method. I have tried the following code but can't seem to get it to compile.
class foo =
object (self)
method loopTest =
let rec doIt x =
Printf.printf "%d\n" x;
if x>1 then doIt (x+1)
end;;
How do I create a recursive function of this sort within a m...
Let's say one has a class that performs a certain type of task. And let's say that there are a number of variations of that task. The actions are the same, just a few parameters change (e.g., for soft boiled egg, action = boil, time = 5 min.; for hard boiled egg, action = boil, time = 11 min., etc.). Number of parameters that vary is abo...
Hello all,
I've just found this interesting presentation about the concept of "object oriented CSS". It seems to be a good idea but the presentation is rather short and doesn't give a lot of examples.
My questions:
is this concept relevant?
what are the benefits of OOCSS?
can you provides me with complex exemples of "object oriented ...
Just to clarify, I left school some years ago entering with no or very little programming experience. The programming classes was primary c++ and java. The focus was heavily OOP related with interfaces, abstract classes and so on. After working in the IT industry for some years, slowly the benefit of "real" OOP programming is becoming cl...
I'm just starting to get my mind around this whole Object Oriented thing, so bear with me.
So, I saw an example of an object function (for Javascript) where you assign a new value and that value gets assigned as that property's actual value. Example:
function Meat (name, color, price) {
function newPrice (new_price) {
this....
I have to implement Java.Polynomial as a school assignment. Part of the methods are add(polynomial), multiply(polynomial) etc.
In the case of something like
p.add(q); // computes p + q
is it better to return void and keep the sum of the polynomials in p? or is it better to return a polynomial and keep the former value of p intact?
M...
While modeling classes what is the preferred way of initializing it,
Constructors
Factory Methods
and what would be the considerations of using either of them.
In certain situations I prefer having a factory method which returns null if the object cannot be constructed. This makes the code neat. I can simply check if the returned va...
Could any CL'er please explain 'slots' in CLOS? I am finding it difficult to understand the part after the slot name. That is in :
(defclass foo ()
(data1 :initarg foo))
What do the 'initarg' and other such similar things mean? I am re-reading manuals. So, I would really appreciate if any of you here could explain it to a layman like ...