Main Page | Report this Page
Computers Forum Index  »  Computer - Object  »  Looking for real world examples to explain the...
Page 1 of 2    Goto page 1, 2  Next

Looking for real world examples to explain the...

Author Message
frebe...
Posted: Thu May 14, 2009 5:28 am
Guest
On May 14, 4:05 am, "amake... at (no spam) gmail.com" <amake... at (no spam) gmail.com> wrote:
Quote:
I found it difficult to come up with any. I was wondering if this is
because the world is inherently OO by nature,

No, the world is neither OO nor procedural in nature. Objects and
classes are a mechanism used in software development. It is a part of
the world (like computers are parts of the world), but it has nothing
to do with philosofi.

Quote:
and the whole original
methodologies of designing software by linearly ("what do you do
next") or procedurally was really off the ball and a complete mis-
conception of the nature of things.

OO is also an imperative (linear) technique. There are non-imperative
languages like Haskell, Erlang, etc. But they are not OO.

Quote:
However, recently, it occurred to me, that maybe the difference is
centered around the how we look at things: what can we do with them to
achieve a particular goal (procedural) or what are these things
capable of doing (OO).

E.g., a new manager is hired into an existing department. If he
focuses on who his workers are: their strengths and weaknesses, then
that's OO. But if just careers ahead defining goals with thinking
about the capabilities of his workers, then that's procedural.

The main problem is when you start to look at the world in black-and-
white. Objects and classes are useful tools in some scenarios.
Functions are useful too. The real problem starts when you have
languages like Java, that only have classes and doesn't have
functions.

Quote:
Another example: If I wanted to make a model to represent all the
factories in a town. What would a OO model look like and what would a
procedural  model look like?

The OO model is almost identical to the network model. In business
software of today, most likely the relational model would be used for
model factories in a town. The network model lost the battle against
the relational model more than 20 years ago. OO people have tried to
picked the network model (OODBMS) up again, but they have failed.

//frebe
 
S Perryman...
Posted: Thu May 14, 2009 12:50 pm
Guest
frebe wrote:

Quote:
On May 14, 4:05 am, "amake... at (no spam) gmail.com" <amake... at (no spam) gmail.com> wrote:

I found it difficult to come up with any. I was wondering if this is
because the world is inherently OO by nature,

No, the world is neither OO nor procedural in nature. Objects and
classes are a mechanism used in software development. It is a part of
the world (like computers are parts of the world), but it has nothing
to do with philosofi.

Objects are a conceptual metaphor that one guy in Norway in the 1960s
wanted to use to use to model/simulate real world stuff with on computers.

That guy decided on that metaphor after realising that a procedural view
of said real world couldn't naturally/easily represent what he wanted to
do.

That guy got together with another guy to devise a prog lang that would
realise this concept. That language was called Simula.

The rest is (OO) history.


Quote:
and the whole original
methodologies of designing software by linearly ("what do you do
next") or procedurally was really off the ball and a complete mis-
conception of the nature of things.

OO is also an imperative (linear) technique.
There are non-imperative languages like Haskell, Erlang, etc. But they are not OO.

Which are also "linear".
W
M


Quote:
The main problem is when you start to look at the world in black-and-
white. Objects and classes are useful tools in some scenarios.
Functions are useful too. The real problem starts when you have
languages like Java, that only have classes and doesn't have
functions.

Yes, the dogmatic imposition of one paradigm to the exclusion of others
is indeed a big problem in prog langs. That is why those that support
many (FP, C++ etc) are more powerful or useful than those that don't.


Quote:
The OO model is almost identical to the network model.

And almost identical to the relational model.
Objects have relationships with other objects.

You have made the oh so common mistake of confusing *concept* with
*implementation of concept* (re the above, your comments on
"imperative" etc) .


Regards,
Steven Perryman
 
frebe...
Posted: Thu May 14, 2009 1:25 pm
Guest
On May 14, 10:50 am, S Perryman <a... at (no spam) a.net> wrote:
Quote:
frebe wrote:
On May 14, 4:05 am, "amake... at (no spam) gmail.com" <amake... at (no spam) gmail.com> wrote:
I found it difficult to come up with any. I was wondering if this is
because the world is inherently OO by nature,
No, the world is neither OO nor procedural in nature. Objects and
classes are a mechanism used in software development. It is a part of
the world (like computers are parts of the world), but it has nothing
to do with philosofi.

Objects are a conceptual metaphor that one guy in Norway in the 1960s
wanted to use to use to model/simulate real world stuff with on computers..

That guy decided on that metaphor after realising that a procedural view
of said real world couldn't naturally/easily represent what he wanted to
do.

That guy got together with another guy to devise a prog lang that would
realise this concept. That language was called Simula.

The fact that OO has proven to be useful for some simulation tasks
doesn't imply that the world is inherently OO by nature.

Quote:
and the whole original
methodologies of designing software by linearly ("what do you do
next") or procedurally was really off the ball and a complete mis-
conception of the nature of things.
OO is also an imperative (linear) technique.
There are non-imperative languages like Haskell, Erlang, etc. But they are not OO.

Which are also "linear".
W
M

I think you should read http://en.wikipedia.org/wiki/Imperative_programming..

Quote:
The main problem is when you start to look at the world in black-and-
white. Objects and classes are useful tools in some scenarios.
Functions are useful too. The real problem starts when you have
languages like Java, that only have classes and doesn't have
functions.

Yes, the dogmatic imposition of one paradigm to the exclusion of others
is indeed a big problem in prog langs. That is why those that support
many (FP, C++ etc) are more powerful or useful than those that don't.

The OO model is almost identical to the network model.

And almost identical to the relational model.

Show me how you apply 2NF to objects.

Quote:
Objects have relationships with other objects.

The relational model doesn't have relationships. (Maybe you think of
referential constraints?).

Quote:
You have made the oh so common mistake of confusing *concept* with
*implementation of concept* (re the above, your comments on
"imperative" etc) .

Do you claim that the network and relational models are
implementations of the same concept?

//frebe
 
frebe...
Posted: Thu May 14, 2009 1:32 pm
Guest
On May 14, 1:13 pm, Thomas Gagne <TandGandGA... at (no spam) gmail.com> wrote:
Quote:
Avi,

With kids (really little ones), you have to do everything for them.  
Brush their teeth, feed them, bath them, dress them.

put toothpaste on brush.
insert toothbrush into child's mouth.
do {
    move brush up;
    move brush down;
    move brush randomly;

} until (satisfied)

Object Oriented Programming is like having older kids.  Instead of
grabbing a brush and cleaning their teeth or  I can say

    child.brushTeeth()

And how would the implementation of bruthTeeth look like? What is
wrong with the procedure

brushTeeth(child)

?

Quote:
or

    child.bathe()

or
bathe(child)

Quote:
Or with a really talented dog object I could

    dog.brushTeeth()

brushTeeth(dog)

Quote:
A good way, I think, of measuring whether programmers think procedurally
or OOly is to gauge how often they use simple properties, or expose all
an object's variables publicly.  

In layered enterprise applications, exposing object properties is
unavoidable. Maybe that is a proof why OO sucks in such applications.

//frebe
 
Thomas Gagne...
Posted: Thu May 14, 2009 3:13 pm
Guest
Avi,

With kids (really little ones), you have to do everything for them.
Brush their teeth, feed them, bath them, dress them.

put toothpaste on brush.
insert toothbrush into child's mouth.
do {
move brush up;
move brush down;
move brush randomly;
} until (satisfied)

Object Oriented Programming is like having older kids. Instead of
grabbing a brush and cleaning their teeth or I can say

child.brushTeeth()

or

child.bathe()

Or with a really talented dog object I could

dog.brushTeeth()

A good way, I think, of measuring whether programmers think procedurally
or OOly is to gauge how often they use simple properties, or expose all
an object's variables publicly. Of course, there are cases when that
makes sense but it is not necessary for every object.
 
...
Posted: Tue May 19, 2009 6:16 am
Guest
On 14 Maj, 15:25, frebe <freb... at (no spam) gmail.com> wrote:
Quote:

Show me how you apply 2NF to objects.


2NF is not well-defined, I'm afraid. Without a string of caveats it's
mathematical mumbo-jumbo.

Quote:
Objects have relationships with other objects.

The relational model doesn't have relationships.

Which is a great weakness of the relational model - fully acknowledged
by the relational community - since its inception. Even today, it is
proposed that most users should interact with a relational model of
data consisting of a collection
of relationships rather than relations.

Relations have always played second-fiddle to relationships because
relations are logically inferior.
 
frebe...
Posted: Tue May 19, 2009 12:37 pm
Guest
On 19 Maj, 08:16, saraberg... at (no spam) hotmail.co.uk wrote:
Quote:
On 14 Maj, 15:25, frebe <freb... at (no spam) gmail.com> wrote:



Show me how you apply 2NF to objects.

2NF is not well-defined, I'm afraid. Without a string of caveats it's
mathematical mumbo-jumbo.

References please.

Quote:

Objects have relationships with other objects.

The relational model doesn't have relationships.

Which is a great weakness of the relational model - fully acknowledged
by the relational community - since its inception.

References please

Quote:
Even today, it is
proposed that most users should interact with a relational model of
data consisting of a collection
of relationships rather than relations.

Who proposes that?

Quote:
Relations have always played second-fiddle to relationships because
relations are logically inferior.

Your opinion, or do you have some support for that statement?

//frebe
 
frebe...
Posted: Tue May 19, 2009 2:17 pm
Guest
On 19 Maj, 15:14, S Perryman <a... at (no spam) a.net> wrote:
Quote:
frebe wrote:
On May 14, 10:50 am, S Perryman <a... at (no spam) a.net> wrote:

F>OO is also an imperative (linear) technique.
F>There are non-imperative languages like Haskell, Erlang, etc. But they
are not OO.

Which are also "linear".
W
M
I think you should readhttp://en.wikipedia.org/wiki/Imperative_programming.

Dont' need to. But you obviously do.
Be careful to put the blinkers on when you come to the bit that tells you
that imperative programs are also declarative.

And you better sit down before I tell you that Functional Programming is
also imperative.

Since you don't bothered to read it, i will snip one part for you:
"Declarative programming is a non-imperative style...Functional and
logical programming languages are characterized by a declarative
programming style."

Quote:
That aside, you introduce a bogus term "linear" that nobody has defined or
used. Given your confusion about imperative/declarative programming,
perhaps you meant *sequential* .

I didn't introduce the term "linear". But I interpreted it as
"imperative".

Quote:
F>The OO model is almost identical to the network model.

And almost identical to the relational model.
Show me how you apply 2NF to objects.

Dpes the 2NF of the *"Relational" data* model apply to OO ??

What is the meaning of "Dpes"? I dont understand your statement.

Quote:
Here is an OO *relational* model (in UML) of the example :

       1..*               *
Skill --------- Employee -------- Current Work Location
               *              0..1

How does 2NF apply to that?

Quote:
Objects have relationships with other objects.
The relational model doesn't have relationships. (Maybe you think of
referential constraints?).

The relational model does have relationships (the clue is in the name) .

Nope. Please show some references.

Quote:
You have made the oh so common mistake of confusing *concept* with
*implementation of concept* (re the above, your comments on
"imperative" etc) .
Do you claim that the network and relational models are
implementations of the same concept?

1. What is a "network" model ?? A graph ??
If so, graphs are relationships.

2. Are you asking whether graphs can be used to implement a relational
    model ??

No, I am asking if you meant that the network and relational models
are implementations of the same concept?

//frebe
 
S Perryman...
Posted: Tue May 19, 2009 5:14 pm
Guest
frebe wrote:

Quote:
On May 14, 10:50 am, S Perryman <a... at (no spam) a.net> wrote:

F>OO is also an imperative (linear) technique.
F>There are non-imperative languages like Haskell, Erlang, etc. But they
are not OO.

Quote:
Which are also "linear".
W
M

I think you should read http://en.wikipedia.org/wiki/Imperative_programming.

Dont' need to. But you obviously do.
Be careful to put the blinkers on when you come to the bit that tells you
that imperative programs are also declarative.

And you better sit down before I tell you that Functional Programming is
also imperative.

That aside, you introduce a bogus term "linear" that nobody has defined or
used. Given your confusion about imperative/declarative programming,
perhaps you meant *sequential* .


F>The OO model is almost identical to the network model.

Quote:
And almost identical to the relational model.

Show me how you apply 2NF to objects.

Dpes the 2NF of the *"Relational" data* model apply to OO ??

Feel free to show us how/why this is so.
Here is an example for you : http://en.wikipedia.org/wiki/2NF

Here is an OO *relational* model (in UML) of the example :

1..* *
Skill --------- Employee -------- Current Work Location
* 0..1


Quote:
Objects have relationships with other objects.

The relational model doesn't have relationships. (Maybe you think of
referential constraints?).

The relational model does have relationships (the clue is in the name) .

Perhaps what you call the "Relational" model doesn't.


Quote:
You have made the oh so common mistake of confusing *concept* with
*implementation of concept* (re the above, your comments on
"imperative" etc) .

Do you claim that the network and relational models are
implementations of the same concept?

1. What is a "network" model ?? A graph ??
If so, graphs are relationships.

2. Are you asking whether graphs can be used to implement a relational
model ??

For a graph G = (V,E) , that will depend on what you define E to be,
will it not (the adjacency function is defined on E) .


Regards,
Steven Perryman
 
John \"Z-Bo\" Zabroski...
Posted: Tue May 19, 2009 10:33 pm
Guest
On May 19, 6:08 pm, "John \"Z-Bo\" Zabroski" <johnzabro... at (no spam) gmail.com>
wrote:
Quote:

Part of the major flaw in this is
actually related to the fact that they didn't properly integrate with
WCF (Windows Communication Foundation) and WPF (Windows Presentation
Foundation).

I forgot to explain that what all three of these subsystems lack is a
common, shared MetaObjectProtocol.dll. This is the fundamental design
flaw with .NET's object system, actually: no support for a meta-object
protocol or meta-level architectural decisions. As such, it is a
difficult platform for MDA.

So you can be "right" in calling .NET "object-based", if by "object-
based" you mean no built-in escape hatch for a metalevel
architecture. As a consequence of this lack of built-in escape hatch
(the missing MetaObjectProtocol.dll problem), you see problems
repeatedly solved over-and-over, ballooning the size of the .NET
runtime installation. For instance, JScript 8.0's Expando properties
solve the same problem as WPF's DependencyObject/DependencyProperty
objects as well as WCF's DependencyObject/DependencyProperty objects.
(Yes, WCF and WPF duplicate the same solution to the same problem to
the point of having the same names for the same concepts -- the only
difference is WPF's version has hardcoded flags for optimizing
rendering).
 
John \"Z-Bo\" Zabroski...
Posted: Tue May 19, 2009 10:48 pm
Guest
On May 19, 2:16 am, saraberg... at (no spam) hotmail.co.uk wrote:
Quote:
On 14 Maj, 15:25, frebe <freb... at (no spam) gmail.com> wrote:



Show me how you apply 2NF to objects.

2NF is not well-defined, I'm afraid. Without a string of caveats it's
mathematical mumbo-jumbo.

Objects have relationships with other objects.

The relational model doesn't have relationships.

Which is a great weakness of the relational model - fully acknowledged
by the relational community - since its inception.

Could you provide a reference by a relational modelling practitioner
who says the lack of explicit relationships is a weakness?

Quote:
Even today, it is
proposed that most users should interact with a relational model of
data consisting of a collection
of relationships rather than relations.

Sorry, I need a concrete example of what that would look like. I am
guessing I already have done something like this, but never used such
hyperbole to describe it.

Quote:
Relations have always played second-fiddle to relationships because
relations are logically inferior.

I don't understand this statement. Point me to an article that
explains this, or write one yourself and link it back to here (or
stick it in here inline).
 
...
Posted: Wed May 20, 2009 2:56 pm
Guest
On 19 Maj, 14:37, frebe <freb... at (no spam) gmail.com> wrote:
Quote:
On 19 Maj, 08:16, saraberg... at (no spam) hotmail.co.uk wrote:

On 14 Maj, 15:25, frebe <freb... at (no spam) gmail.com> wrote:

Show me how you apply 2NF to objects.

2NF is not well-defined, I'm afraid. Without a string of caveats it's
mathematical mumbo-jumbo.

References please.

1NF is not well defined, see:
http://en.wikipedia.org/wiki/1NF

Particularly, " ... there is no universal agreement as to which
features would disqualify a table from being in 1NF."

2NF is based on 1NF. As 1NF is not well-defined, then neither is 2NF.
Nor is any normal form. They are all ambiguous.

Quote:



Objects have relationships with other objects.

The relational model doesn't have relationships.

Which is a great weakness of the relational model - fully acknowledged
by the relational community - since its inception.

References please

See, "A Relational Model of Data for Large Shared Data Banks," by E.
F. CODD.

Particularly, "Users should not normally be burdened with remembering
the domain ordering of any relation (for example, the ordering
supplier, then part, then project, then quantity in the relation
supply). Accordingly, we propose that users deal, not with relations
which are domain-ordered, but with relationships which are their
domain-unordered counterparts."


Quote:

Even today, it is
proposed that most users should interact with a relational model of
data consisting of a collection
of relationships rather than relations.

Who proposes that?

E. F. CODD, the inventor of the relational model, see above.

Also the particular, "To sum up, it is proposed that most users should
interact with a relational model of the data consisting of a
collection of time-varying relationships (rather than relations)."


Quote:

Relations have always played second-fiddle to relationships because
relations are logically inferior.

Your opinion, or do you have some support for that statement?

E. F. CODD's opinion.
 
topmind...
Posted: Wed May 20, 2009 6:43 pm
Guest
frebe wrote:
Quote:
On May 20, 4:56 pm, saraberg... at (no spam) hotmail.co.uk wrote:
On 19 Maj, 14:37, frebe <freb... at (no spam) gmail.com> wrote:

On 19 Maj, 08:16, saraberg... at (no spam) hotmail.co.uk wrote:

On 14 Maj, 15:25, frebe <freb... at (no spam) gmail.com> wrote:

Show me how you apply 2NF to objects.

2NF is not well-defined, I'm afraid. Without a string of caveats it's
mathematical mumbo-jumbo.

References please.

1NF is not well defined, see:http://en.wikipedia.org/wiki/1NF

Particularly, " ... there is no universal agreement as to which
features would disqualify a table from being in 1NF."

2NF is based on 1NF. As 1NF is not well-defined, then neither is 2NF.
Nor is any normal form. They are all ambiguous.

I agree that 1NF has been redefined (by Chris Date and others) to
include virtually anything. The definition of 2NF is:

a 1NF table is in 2NF if and only if none of its non-prime attributes
are functionally dependent on a part (proper subset) of a candidate
key.

Since 1NF can mean almost anything, the requirment "1NF table" doesn't
exclude much, but in what way does it make 2NF (and all other normal
forms) "mumbo-jumbo"?


The biggest practical issue with regard to normalization-level is
based on the issue of whether a pattern is permanent or temporary.
Some patterns are fleeting and some last forever. If you factor out
all existing repetition patterns in the data, you may create the
maintenance headache of removing or working around the normalization
when the pattern disappears.

For example, one common example (not 1nf or 2nf) assumes all pizza
types are available at all pizza shops. If you have a system like this
and some shops start offering more or fewer pizza types from the
"standard", then you have a big headache on your hand. It simplifies
the system while that same-ness condition is true, but not when it
disappears.

Many off-the-shelf systems have tons of many-to-many tables to
increase the flexibility to serve different organizations, but often
this complicates using the data if a given shop only needs say a one-
to-many relationship. I once tried to project (map) such into a one-to-
many to make it easier for our shop to digest, but there was enough
"dirt" in the data to prevent this. A rogue process wasn't adhering to
our shop-specific one-to-many use, allowing typos in. Even if we found
the rogue, the vendor would likely drag their feet. Sometimes I think
purchasing the source-code outright is better than the subscription
process, because vendor updates that mostly cater to other customers
can cause headaches.

A big part of good design involves guessing the likelihood of
different kinds of potential changes. It's impossible to always get
it right, but hopefully one can increase the possibility of getting it
right. I'm not sure a book can teach this kind of experience (other
than maybe providing a high quantity of actual scenarios to study).

[...]

Quote:
//frebe

-T-
 
Daniel T....
Posted: Thu May 21, 2009 4:52 pm
Guest
On May 21, 1:43 am, "cr88192" <cr88... at (no spam) hotmail.com> wrote:
Quote:
"Daniel T." <danie... at (no spam) earthlink.net> wrote in message
On May 20, 12:40 pm, "cr88192" <cr88... at (no spam) hotmail.com> wrote:

[Things we agree on snipped.]

Quote:
typically, I don't use contexts for functions which are essentially
stateless (and will always be stateless).
IMO, it just seems a little silly to put these as static methods in some
particular class. similarly for types/objects which are conceptually
atomic
and pass-by-value. ...

yes, such things exist...

You mean a procedure that doesn’t return information nor change any
values in memory?

well, it can return stuff...

but, yes, all input is provided in arguments, and any return value depends
purely on the input...

this is typical of many mathematical functions, ...
traditionally, these would be things like sin, cos, tan, ...

but could include things like sinc, integrators, interpolators, ...
also typical is to implement custom math support, for example, vector and
quaternion support, ...

however, the typical "OO" mindset tends to ignore the existence of things
like this... (like, math is some kind of novelty no "real" programmers
use...).

but, yes, in these cases we don't need a context...

Hold on a second, obviously you do need a context because you are
passing in parameter(s)... they are your context.

Functions which require only one parameter fit nicely in the OO model
(e.g., sin, cos, and tan,) but I agree that there are many functions
which need more than one object[1] and there is no reason to give any
single object primacy.

[1]I'm using the definition of 'object' as it used in the C standard.
 
cr88192...
Posted: Thu May 21, 2009 11:19 pm
Guest
"Daniel T." <daniel_t at (no spam) earthlink.net> wrote in message
news:94ca2caa-48bd-4bd3-8573-58d8343491a3 at (no spam) j18g2000yql.googlegroups.com...
On May 21, 1:43 am, "cr88192" <cr88... at (no spam) hotmail.com> wrote:
Quote:
"Daniel T." <danie... at (no spam) earthlink.net> wrote in message
On May 20, 12:40 pm, "cr88192" <cr88... at (no spam) hotmail.com> wrote:

[Things we agree on snipped.]

Quote:
typically, I don't use contexts for functions which are essentially
stateless (and will always be stateless).
IMO, it just seems a little silly to put these as static methods in
some
particular class. similarly for types/objects which are conceptually
atomic
and pass-by-value. ...

yes, such things exist...

You mean a procedure that doesn’t return information nor change any
values in memory?

well, it can return stuff...

but, yes, all input is provided in arguments, and any return value depends
purely on the input...

this is typical of many mathematical functions, ...
traditionally, these would be things like sin, cos, tan, ...

but could include things like sinc, integrators, interpolators, ...
also typical is to implement custom math support, for example, vector and
quaternion support, ...

however, the typical "OO" mindset tends to ignore the existence of things
like this... (like, math is some kind of novelty no "real" programmers
use...).

but, yes, in these cases we don't need a context...

<
Hold on a second, obviously you do need a context because you are
passing in parameter(s)... they are your context.

Functions which require only one parameter fit nicely in the OO model
(e.g., sin, cos, and tan,) but I agree that there are many functions
which need more than one object[1] and there is no reason to give any
single object primacy.

[1]I'm using the definition of 'object' as it used in the C standard.
Quote:



what I mean by context here is a context-struct...

I usually use context structs (as opposed to globals) for most things, as it
is common for me to want to be able to have multiple instances of many
things, and also because personally I feel using globals in too many places
is tacky and leads to maintainability issues...

however, a context struct is not necessary for functions which don't use or
modify any external state...
in these cases, a class would serve as little more than a scoping
mechanism...

however, it is an annoyance that both Java and C# don't support things like
functions outside of classes, so one is forced into using a class even in
cases where a global-function or namespace-scoped function would be
conceptually more appropriate...

technically, my compiler allows them as an 'unofficial' extension, along
with global variables, ... in large part due to the goal of C and C++
interop (and also because, in my framework, all of them are using most of
the same compiler machinery anyways...).
 
 
Page 1 of 2    Goto page 1, 2  Next
All times are GMT
The time now is Thu Dec 10, 2009 3:05 am