I find myself very often creating an object that has no public methods and is self-contained. It typically handles events of arguments passed to its constructor in its private methods and does not raise any events or expose any public methods.
I am calling this type of objects "passive" objects - objects that do not have any public meth...
I'm trying to get my head round Unit Testing and there's one more piece of the jigsaw I need to find.
What I'm trying to do is write tests for the following code. In this case, I've got a really simple Front Controller (written in PHP).
class frontController
{
public function routeRequest($oRequest)
{
$sClassname = $oReques...
In C#, I know that I can overload the constructor for a class by specifying it in the body of the class:
public class MyClass()
{
public MyClass(String s) { ... }
}
This overrides the default constructor (which has no parameters) and forces the class to be initialized with parameter s.
I know that in VBA I can initialize my class...
I'm currently working with an online application that requires multiple screens/steps in order to complete. The application domain is modeled using an object graph. Persistence to and from a database is done using an ORM package.
As I progress through the screens I build up the object graph. Between screens I serialize/deserialize the o...
I'm using Damian Conway's "inside-out" objects as described is his wonderful book Perl Best Practices to construct an object-oriented interface to a security system at my client. I'm coming across the need to use internal helper methods within my module that I would normally designate as "_some_method". However, this seems to break enc...
which come first class or object in object oriented languages ?
...
Hi ,
Generally we need to modularize our design.ie., we have to breakup our application logic into set of small functions.And then integrate these functions to achieve our ultimate functionality.But from the language(java) perspective ,invoking a method involves more stack operations(push and pop the method address from stack).How to com...
Hello,
I am currently trying to get my head around OOP in PHP, I understand the basic concepts etc.
Up to this I have been working for tutorials and books.
What I am looking for is some good tutorials that use real examples [ie make a functioning application] or a simple well written application [with source code] so I can look through ...
I need an alternative to Java, because I am working on a genetics-calculation project.
It takes a lot of memory and the most of the cpu time. And therefore it won´t work when I deploy it on a server, because many people use the program at the same time.
Does anybody know another language that is not running in a virtual machine and is s...
Hi,
i am experimenting with overloading the < operator (i'll add the > later) as a means for checking if one of the goldfish (please see code below) is within the territory of another (the territories can overlap). im getting multiple compile errors with teh code - primarily to do with being able to access the private variables, even ...
Hello,
I have a application that in one form(Form1) I have many checkBoxes and textBoxes and in Form2 I have only a textBox, but I want to put some contents from the Form1 textBoxes and put in the Form2 textBox, like this, but between forms:
textBox1.Text = "Test: " + textBox1 + "\n" + textBox3;
As textBox1 in Form2 and the second te...
Beginner in python, but been programming for about 5 years now. I suspect I have a lot to learn about doing things the object oriented way, but I know the basics. I planned on programming a calculator that shows it's work for the challenge and knowledge i'll gain from it. I just started and this is what i've got, and it just looks really...
Is it possible to define attributes to a class in the constructor.
For instance I pass a Associative Array to a class constructor and I want the attributes to that class to be declared and set based on what is in the Associative Array.
TIA
...
I dont quite understand why Static methods can be inherited in Java ?
Inheritance is like inheriting from the base class AND Static belongs to the Class and not Object.
So if the Static belongs to the Class only why does it trickle down to the derived class ?
Shouldn't it just stay with the Class in which it was defined ?
Is Inheriti...
I am trying to wrap my head around object oriented programming.
My understanding is that we have objects so we can design our programs to mirror real-life objects.
Lets take a class hierarchy:
Fruit (base)
Apple
Fruit has a function void Eat(). Obviously you can use Fruit polymorphically if Eat() is virtual. But does this make sen...
Friends,
I am asking this question with performance as main concern. But I would like to know other possible advantages / disadvantages for both approaches.
The question is: Since properties are converted to methods in IL, could there be significant performance penalty if properties are called instead of accessing fields directly (from...
What types in C++ can be instantiated?
I know that the following each directly create a single instance of Foo:
Foo bar;
Foo *bizz = new Foo();
However, what about with built-in types? Does the following create two instances of int, or is instance the wrong word to use and memory is just being allocated?
int bar2;
int *bizz2 = new ...
I have a SalesOrder class which is inherited by several different types of sales orders. It has a method called ValidateItems(OrderItemList, itemAdditionalValidation), which takes in a list of order items and a delegate for additional validation on an order item. The different sales orders each define their own version of the delegate a...
Hi all
Over the years i have followed the techniques of DB normalization to atleast identify the relationships and entities of my object models , it always got me closer to a very reasonable design.
Recently i came across this research paper, which actually deals with the same
http://www.decodephp.com/oo-design-normlization.pdf
how ...
Hi Guys.
I am trying to find an elegant framework to arrange all of my server components.
The server:
1. Receives a request, as a XML string, from the client.
2. Validates the messages ( !null && !empty mainly).
3. Unmarshalls the message into a Request object.
4. Validates the internals of the Request object (ensures all the requi...