 |
AppletTalk.com Java discussions newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Kevin Guest
|
Posted: Tue Jul 08, 2003 5:57 pm Post subject: OO programs in Java... or not? |
|
|
All,
Just out of curiosity, when a programmer is writing a Java program, say, a
Customer Maintenance program (reads from customer file, changes data, writes
back to customer file, etc) does it have to be written as an Object Oriented
program (customer is an object with state and behavior) or can he write is
as a procedural program (read records from file, act on records, write them
back, etc).
I guess I'm wondering if writing all programs in Java require them to be
Object based?
What's your opinion?
Thanks!
Kevin
--
"Experience is a hard teacher because she gives the test first, the lesson
later."
|
|
| Back to top |
|
 |
Chris Mays Guest
|
Posted: Tue Jul 08, 2003 6:25 pm Post subject: Re: OO programs in Java... or not? |
|
|
Well, all Java code has to exist within a class, but I don't see why you
couldn't structure it just like a structured program. I would think, however,
that if that's what you really wanted, you'd be better off choosing another
language for the development.
Chris
Kevin wrote:
| Quote: | All,
Just out of curiosity, when a programmer is writing a Java program, say, a
Customer Maintenance program (reads from customer file, changes data, writes
back to customer file, etc) does it have to be written as an Object Oriented
program (customer is an object with state and behavior) or can he write is
as a procedural program (read records from file, act on records, write them
back, etc).
I guess I'm wondering if writing all programs in Java require them to be
Object based?
What's your opinion?
Thanks!
Kevin
--
"Experience is a hard teacher because she gives the test first, the lesson
later."
|
|
|
| Back to top |
|
 |
Brad BARCLAY Guest
|
Posted: Tue Jul 08, 2003 7:31 pm Post subject: Re: OO programs in Java... or not? |
|
|
Kevin wrote:
| Quote: | All,
Just out of curiosity, when a programmer is writing a Java program, say, a
Customer Maintenance program (reads from customer file, changes data, writes
back to customer file, etc) does it have to be written as an Object Oriented
program (customer is an object with state and behavior) or can he write is
as a procedural program (read records from file, act on records, write them
back, etc).
I guess I'm wondering if writing all programs in Java require them to be
Object based?
What's your opinion?
|
You can't write a Java program that isn't comprised of at least one
object -- so in essence, you cannot escape object orientation when
programming in Java.
You could, however, develop your object in a monolithic manner tha
minimizes the object-orientation of your code. Why you'd want to do
this is beyond me -- the end result is generally messy and really
difficult to maintain, and can ofter suffer performence problems.
(I was brought into a project once that was written for Java 1.0 (back
in the day...) by a pair of C programmers who knew nothing about OOP. I
was asked to determine why it suffered such horrendous performance, and
fix it if possible. After two days of slogging through code that barely
made any sense, I scrapped the entire codebase and had to start recoding
the project from scratch -- absolutely nothing was reusuable).
Brad BARCLAY
--
=-=-=-=-=-=-=-=-=
From the OS/2 WARP v4.5 Desktop of Brad BARCLAY.
The jSyncManager Project: http://www.jsyncmanager.org
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|