oop

Object Oriented Model on top of LINQ to SQL

I'm playing a bit with LINQ to SQL and overall it's a much better option than what Microsoft had before (DataSet), but it seems that object-oriented capabilities are still limited. Since we currently use a custom persistence framework that created a OO model on top of DataSet, I'm looking to port the framework to a new version building a...

Design Hints, Payroll System...repost

Hi, We are designing a Payroll Generation System for a client. The organization we are targeting has a hierarchy as follows: Company -> Cluster -> Business Unit (BU) -> Department -> Employee The salary for an employee is made up of various salary components. Each salary component has 3 rules associated with it, a Calculation Rule (Ca...

What conventions exist for ordering arguments in methods?

A colleague and I are discussing best practices regarding ordering method parameters. The goal is to establish a standard in our organization to improve readability and productivity by giving our methods common signatures. We are merely establishing guidelines for the recent grads we are hiring. Example (userId is always passed in t...

How do properties work in Object Oriented MATLAB?

I am trying to create a MATLAB class with a member variable that's being updated as a result of a method invocation, but when I try to change the property within the class it (apperently, from what I understood from MATLAB's memory management) creates a copy of the object and then modifies it, leaving the original object's property untou...

Payroll System Design, Business Logic in SPs or Application Layer (C#.Net), Maintainability - Repost

Hi, We are designing a Payroll Generation System for a client. The organization we are targeting has a hierarchy as follows: Company -> Cluster -> Business Unit (BU) -> Department -> Employee The salary for an employee is made up of various salary components. Each salary component has 3 rules associated with it, a Calculation Rule (Ca...

Try to describe polymorphism as easy as you can

we can find a lot of information about the subject on the internet and books http://en.wikipedia.org/wiki/Type_polymorphism but lets try to make it as simple as we can . ...

What is the industry and community best practice for coding proper maintainable readable jQuery for a large codebase?

Coming from a Ruby background, I'm used to writing all my code using classes with methods and such. I do know javascript quite well, but I'm new to jQuery and its best practices. Obviously there are a million ways to simulate classes in javascript. But, what is the actual jQuery community REALLY using in the real world? Specific exampl...

What exactly is the singleton class in ruby?

It seems as if I'm missing the point or misunderstanding the significance of the singleton class in Ruby. I've heard and read it in many ways—some more complicated than others—and left more confused as to what it is. Is it a class in and of itself? Is it the reason why all objects belong to "class?" The concept in play here is fuzzy. I'm...

Should a method that implements an interface method be annotated with @Override

Intro My real question is about the use of the annotation. Trying to find an answer myself, I ran into several other questions. This is why there are also related questions below. I hope this is not too confusing. Question Should a method that implements an interface method be annotated with @Override? Eclipse for instance automatical...

Do the concepts in Accelerated C++ Practical Programming by Example still hold up today?

I was recommeded a book called: Accelerated C++ Practical Programming by Example by Andrew Koenig and Barbara E. Moo Addison-Wesley, 2000 ISBN 0-201-70353-X The basis of this book is that Object Oriented Programming is highly wasteful memory-wise, and that most source-code should not be written this way, rather that you should use ...

Number of classes in large projects

I'm just wondering about large projects - say an airlines reservation system, how many classes/objects it is likely to have. Objects: customer, airplane, airport, route, ticket, order. That's about all I can think of. The project will probably be hundreds of thousands of lines of code, so are there likely to be more classes (that do...

Variable naming schemes for objects in C++?

Hey everyone, I am implementing a BFS, and what it is going to do is go through an ordered tree to find the shortest solution to a puzzle. What i will be doing is creating a Snapshot object that holds the current position of each piece in a puzzle. I will add this Snapshot object into the queue and check if it is the solution. However,...

OOP: Where to stop Abstracting

Where do you draw the line to stop making abstractions and to start writing sane code? There are tons of examples of 'enterprise code' such as the dozen-file "FizzBuzz" program... even something simple such as an RTS game can have something like: class Player {} ;/// contains Weapons class Weapons{} ;/// contains BulletTypes class Bulle...

OOP: When to create derived classes, and when to implement features with conditionals?

When should I continue to make derived classes, and when should I just add conditionals to my code? eg for a missile class Object; class Projectile : public Object; class Missile : public Projectile; class MissileGuided : public Missile; Or should I implement that last one in the missile's code? void Missile::Update() { if(homin...

Object Oriented Best Practices - Inheritance v Composition v Interfaces

I want to ask a question about how you would approach a simple object-oriented design problem. I have a few ideas of my own about what the best way of tackling this scenario, but I would be interested in hearing some opinions from the Stack Overflow community. Links to relevant online articles are also appreciated. I'm using C#, but the ...

What does using a dollar sign after $this-> in PHP mean?

I'm a little confused by some PHP syntax I've come across. Here is an example: $k = $this->_tbl_key; if( $this->$k) { $ret = $this->_db->updateObject( $this->_tbl, $this, $this->_tbl_key, $updateNulls ); } else { $ret = $this->_db->insertObject( $this->_tbl, $this, $this->_tbl_key ); } My question is basically what does $this...

Should I subclass List<T> or have it as a property?

Hi all, I have faced this problem quite often during the last couple of months, during which I've been building this system. The scenario is this: I have this kind of object that essentially is a list of other objects, but has some other properties specific of its nature. For example: Class Tests: Contains many Test objects Has prope...

Getting String Sets into Presentation Layer

We're working on an hospital information system that is being written on C# and using NHibernate to map objects to database. MVC pattern is being used to separate business logic from UI. Here is the problem, How do you get variable sized different set of strings to UI? For example a Contact object have a property named City that holds ...

C#: Force Compiler error on use of myObj.ToString()

I have a class that contains a bunch of properties. It is a mistake by a programmer if they call ToString() on an object of that type. Take this example code: using System; public class Foo { public int ID = 123; public string Name = "SomeName"; private string ToString() { return null; } } public class MyClass { publi...

Are ColdFusion objects passed by reference or by value?

Are ColdFusion objects (i.e. CFCs invoked via cfobject) normally passed by reference or by value (copied in memory)? And is it possible to force ColdFusion to pass an object in either manner? ...