I found the CollectionUtils class a year or so ago and a few of the methods like, collect, and transform seem really cool, however, I have yet to find a use where it would not by syntactically cleaner and\or easier to just write the logic with a simple loop.
Has any found a unique\useful use for these methods (transform, predicatedColl...
In a software system a one-to-one relationship must be modeled between two objects where an active status exists for the relationship.
In other words, ObjectA has a one-to-one relationship to ObjectB (without a back pointer) where the relationship can be either active or inactive. There might also be additional attributes associated wi...
I'd like to accomplish something like this: Call a method, say "turn", and then have "turn" applied differently to different data types, e.g., calling "turn" with a "screwdriver" object/param uses the "turnScrewdriver" method, calling "turn" with a "steeringWheel" object/param uses the "turnSteeringWheel" method, etc. -- different things...
Hello, I am attempting to learn oCaml and am having an issue as to why the below program is invalid.
class myClass2 =
object
method doSomething = Printf.printf "%s\n" "Doing something"
end;;
class myClass foo =
object
val dMember = foo
method doIt = dMember#doSomething
end;;
let mc2 = new myClass2;;
let mc = new myClass mc2;;
mc#do...
Languages such as Java explicitly use the interface keyword to denote interfaces. Having used Java, the concept seems useful enough to me to justify a keyword to enforce the concept.
Of course one can use a pure virtual class and label it as an interface. However, this keyword seems to be so useful and differentiated from a pure virtu...
Aren't Design Patterns an extension to OOP principles? Why are these two concepts treated separately? Can we believe that if someone who knows Design Patterns would definitely be an OOP expert?
...
What is the advantage of local classes in Java or in any other language that makes use of this feature?
...
I'm stuck on a portion of the Java tutorial, specifically this exercise. The exercise asks you to:
1- Write a class whose instances
represent a single playing card from a
deck of cards. Playing cards have two
distinguishing properties: rank and
suit. Be sure to keep your solution as
you will be asked to rewrite it in
Enum...
This may be a generic OOP question. I wanted to do generic comparison between an interface and an abstract class on the basis of their usage. When would one want to use and interface and when would on want to use an abstract class?
...
Suppose you need to define a class which all it does is hold constants.
public static final String SOME_CONST = "SOME_VALUE";
What is the preferred way of doing this?
Interface
Abstract Class
Final Class
Which one should I use and why?
Clarifications to some answers:
Enums - I'm not going to use enums, I am not enumerating anyt...
I'm currently in charge of a process that seems to be very intimate with the database. My program/script/framework's goal is to make uniformity out of disparate data sources. Using a form of dependency injection, my process at a very high level works fine. The implementation of each data source type is hidden from the highest level busin...
I'm looking for the correct way to write my own interface objects.
Say, I want an image that can be double-tapped.
@interface DoubleTapButtonView : UIView {
UILabel *text;
UIImage *button;
UIImage *button_selected;
BOOL selected;
}
// detect tapCount == 2
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event;
This work...
I'm looking for some good courses on object oriented programming. I've been programming for about 4 years so far, but I don't feel like I have a SOLID grasp on OO.
How did you learn?
...
I have been programming in C# and Java for a little over a year and have a decent grasp of object oriented programming, but my new side project requires a database-driven model. I'm using C# and Linq which seems to be a very powerful tool but I'm having trouble with designing a database around my object oriented approach.
My two main qu...
I'm a vb.net developer in small IT department and I'm having trouble making the leap to programming exclusively with objects.
I understand the principles of OOP, design patterns, unit testing, etc, but when it comes to developing my applications, either my object design is poor, or I skip building with objects altogether. I know how to...
What languages support multiple inheritance and what techniques do they use to mitigate the problems that arise from using multiple inheritance?
...
Is it possible to use the __call magic method when calling functions statically?
...
Hi.
As far as I know, using the PhysX API, the only way to obtain an NxActor is from an instance of NxScene using the createActor method. This is really bugging me. I want to keep my code clean, but I feel like there is no choice but to go around passing this scene from constructor to constructor so that classes can make and have refe...
i try to learn design pattern, but it's really really hard to understand main idea of OOD. i have created my software with classic method. On the other hand i want to learn OOD. why i need singleton and others? i coded some simple program: one of them clasical(my style), the other is singleton pattern.Please teach me why do i need single...
I have a base class "Node" which contains a list of child nodes. Node defines a "forEachNode" function which takes a callback as a parameter and calls it on each node in the hierarchy.
I have a class derived from Node - "SpecialNode" (not really a name I'd choose - just an example!). Node knows nothing about SpecialNode.
I want to ite...