Hello,
I have a process class, where if the input contains a value it will also do something else.
For example
Person { name; age }
ProcessPerson(person) //takes in a person
in the ProcessPerson if the age is = over 18 (Adult) then send an email.
The ProcessPerson already exists, and the base logic has to be run no matter what (sa...
Hi,
I've just completed my second OOP class, and both my first and second classes were taught in c#, but for the rest of my programming classes, we will be working in c++. Specifically, we will be using the visual c++ compliler. The problem is, we are required to learn the basics of c++ ourself, with no transition from our professor. So...
Fairly straightforward question. In C++ the parent constructor will be implicitly called before the child constructor, so what logic is there for PHP not to do things this way?
EDIT: I've got a good answer from Lukman, but I was hoping for more of a reason why there is a difference. Maybe the question should be why does C++ not allow cu...
what's the way to do in python the following in C++?
B* b = new D();
b->virtual_fn();
Which would call virtual_fn in D. Are there a form of references to do this?
...
JavaScript is a lightweight and powerful language, but it's often misunderstood and hard to learn (especially about its object oriented programming). Here are what I found:
Books
JavaScript: The Good Parts by Douglas Crockfond, discusses many OOP topics in his 150 page book.
Object-Oriented JavaScript: Create scalable, reusable high-q...
Forgive the dumb newby question but...
I'm moving data from one table to another. The destination table schema is identical to the source table except it has a few extra columns. Linq to SQL generates classes to represent each of these tables. If I have a source object, how do I create a destination object from it?
E.g., source object ha...
hi
1) As far as I’m aware, each domain object instance ( at BLL layer ) should completely represent an element of the domain ( an employee, book, car etc ).
So what is an advantage of having two types of domain objects, say one type representing a particular forum and other type representing a thread(s) in that forum, over having ...
Okay... I'll try to describe it.
It's a text adventure game where you have items you pick up and encounter monsters in rooms (they can be hard-coded in). All my pickups are going to do damage, and the player and the monsters have hitpoints, a name and damage (so the pickups just add to the player's damage when you use them).
We have to...
When I learned about abstract classes is said WT(H*)!!!
QUESTIONS:
What is the point of creating a class that can't be instantiated?
Why would anybody want such a class?
What is the situation in which abstract classes become NECESSARY?
*if you know what i mean
...
I am developing a class library which will include the object Car.
The dilemma is, Car itself will be a class with fields such as Registration Number, and other general information on the car.
But a car has an engine, chassis, etc. These objects need to be modelled too. Should they be classes embedded within Car? If not, what is the us...
Possible Duplicate:
Why does C# not provide the C++ style friend keyword?
A typical example where it might be needed
I have a class with private Init() function and class factory
which I would like to grant access to Init();
...
I'm seeing a huge performance decline in a (command line) PHP script, caused by a simple assignment (runtime increase from 0.8 ~ 0.9 seconds to 29.x seconds).
The script first fetches a lot of data from a MySQL database and creates objects of different custom classes. After this fetching (php now uses around 500 MB of RAM) I loop an arr...
Hey,
I have been designing a site locally in PHP 5, but have come across a few design issues I'd like advice now.
Currently there are three features of the site and each feature has a class . These features are as follows :
a blog
a friends list
a set of images
I have a class for each but in each class I basically define a similar...
I reuse a handful of classes for multiple projects, like Postal Address, State, Zip Code and Phone Number. Associated to them maybe parse/format classes (like Phone Number Formatting).
Is it okay to have a JAR with only a couple of classes? An alternative would be to have one "Miscellaneous" JAR with all the classes however it feels...
Assume this Java code:
public class A {
public A(String g) {
x += g.length();
}
private int x = 0;
}
If I create an instance of A, like this:
A a = new A("geo");
after this call, the value of x will be 3. What am I doing wrong in my Scala code?
class A(val g:String) {
x += g.length
var x:Int = 0
}
object x ext...
I have 2 entities:
Article
Category
I created the mappings so both entities have each others as collections, so:
Article.Categories
Category.Articles
Now, I want to create a method in either ArticleDAO or CategoryDAO to return a paged (subset) of articles.
Which DAO makes sense?
Since the article entity has categories as its collec...
I have just encountered the MS Enterprise Application Library 3.1 in an application I need to support/enhance. I am trying to get up to speed quickly on Microsoft.Practices.EnterpriseLibrary.Data in particular.
The doc on this is quite good but the reading is vast and I am curious about one aspect of this:
Years ago when .Net 1.0 firs...
What OOP principles, if any, don't apply or apply differently in a dynamically typed environment as opposed to a statically-typed environment (for example Ruby vs C#)? This is not a call for a Static vs Dynamic debate, but rather I'd like to see whether there are accepted principles on either side of that divide that apply to one and not...
I'm trying to use some of the more advanced OO features of Javascript, following Doug Crawford's "super constructor" pattern. However, I don't know how to set and get types from my objects using Javascript's native type system. Here's how I have it now:
function createBicycle(tires) {
var that = {};
that.tires = tires;
that....
Sounds a simple question but haven't found a way to do, so would solicit any responses I get.
I have a winform which in turn contains a user control object. based on some condition in the user control, i have to set a value in the winform.
One way could be to pass the winform object as parameter to user control but that would give cycl...