Business Objects

I have been searching the www for some examples on how programmers have
implemented OO models
in a real business environment. Does anyone know of any examples around eg
Orders , inventory.
I am planning a “software development project management system” that I will
be writing in Ruby /Apache / Mysql. I have decided to move away from Perl as
its difficult to refactor my code even after 6 months let alone someone

I am trying to find out the best way to implement an OO structure, so the
question is

Do you take a class and embed all sub classes within the one definition


class Project

class ProjectData


class ProjectSearch


class ProjectScreen


end class


use them seperately using file locations eg

require Project/Data
require Project/Search
require Project/Screen

Any advice would be welcome, or criticism :slight_smile:
Graeme Matthew
Analyst Programmer
Mercer Investment Consulting
Level 29, 101 Collins Street, Melbourne, VIC, 3001, Australia
Tel - 61 3 9245 5352 Fax - 61 3 9245 5330


-----Original Message-----
From: JamesBritt []
Sent: Thursday, 19 September 2002 16:24
Subject: RE: If Statement Help

Hi All

Im currently learning ruby and its going well. I have been looking at a
number of “guru” libraries such as DBI, CGI etc to try and learn
by example.
I have noticed that a number of if statements have the following
syntax eg:


Can someone please explain the ? usage as I have searched all over the
Pragmatic Programmer pages with no answer.

Methods that end with a question mark should return a Boolean value. This
is a coding convention, not a parser-enforced syntax rule.



This e-mail and any attachments may be confidential or legally privileged.
If you received this message in error or are not the intended recipient, you
should destroy the e-mail message and any attachments or copies, and you are
prohibited from retaining, distributing, disclosing or using any information
contained herein. Please inform us of the erroneous delivery by return

Thank you for your cooperation.


Most libraries I’ve seen have a top level “load-it-all” file and sub-files for
independently useful modules. Something like the following:

files in lib

project.rb might contain:

load all project files

require 'project/inventory’
require ‘project/orders’

Individual utilities or tools, might just include only the modules they work with:
require ‘project/inventory’ # just loads the inventory module of the project

inv =

Usually the top level ‘container’ is a module, but you can dynamically add
to the module. For instance project/inventory.rb might have:

module Project
class Inventory

and orders.rb

module Project
class Orders


Alan Chen
Digikata LLC

This is Off Topic, but what’s a business object? Can someone describe
it in plain, programmer language?


I would say: any idea, artifact, person, etc. that exists in a business
environment that you want to model in a computer program.


On Thursday 19 September 2002 06:02 pm, Yohanes Santoso wrote:

This is Off Topic, but what’s a business object? Can someone describe
it in plain, programmer language?


“Yohanes Santoso” wrote in message

This is Off Topic, but what’s a business object? Can someone describe
it in plain, programmer language?

It’s a buzzword.

Well, I’m not sure I fully understand what they are, but it goes like:

Suddenly everthing went from PC desktop spreadsheets to client/server or
C/S - user (client) talks to database (server) (just like in the early days
of computing).
Then came large coorporate WAN and the Internet with many users talking to
one database.
Enter bottleneck.
New buzzword is 3-tier replacing 2-tier (C/S) and multi-tier solutions. User
talks to middle-tier which in turn talks to one or more databases (or other
limited backend resources).

So what exactly does the middle-tier? It implements the business logic that
user requests such as transferring bankaccounts and booking flight seats.

Distributed object models evolve such as COM and DCOM as well as various
Java techonologies such as remote method calls and enterprise beans.
Enter object into middle-tier. These objects are business objects.
The business object controls what happens between the user and the static
datastorage (the database).
It was then learned that these objects were also bottlenecks hogging
resources such as memory and database connections - besides that they didn’t
respond well to crashes and load-balancing.

Enter state-less business objects. These objects don’t remember much if
anything but knows a lot about reacting doing things in response to
requests. (Related supporting non-business objects remember expensive
resources - such as pooling database connections - these can then be
efficiently reused).

Thus a user-request provides a user-id to (say) an available bank account
business object. This object does not represent any particular account at
this point - it was just ready on a random server that happened to not be
too busy. The account object then contacts another business object - an
authentication object - which when happy allows the original account object
to initiate the actual transfer in the database backend. The account object
probably doesn’t contact the database directly but graps an available
database connection object from a pool. Before writing to the database the
account object contacts a distributed transaction service - which is not a
business object but an infrastructure service - the transaction object
ensures that no other user (or the same user) is trying to update the same
account in parallel. When this is done, the user is given an all-ok and the
account object forgets everything again - ready for the next request.
Obviously a lot of things can go wrong - handling all these scenarios are
part of the business objects task.