[netrexx-course] Lesson 1?

classic Classic list List threaded Threaded
28 messages Options
12
Reply | Threaded
Open this post in threaded view
|

[netrexx-course] Lesson 1?

dIon Gillard/Multitask Consulting/AU
Feedback anyone??

dIon Gillard, Sun Certified Java 1.1 Programmer
Work: http://www.multitask.com.au/ | NetRexx: http://www.multitask.com.au/netrexx/
VisualNetRexx: http://www.trongus.com/VisualNetRexx/




----
List Archive: http://www.FindMail.com/list/netrexx-course/ 
To Subscribe: e-mail to [hidden email]
To Unsubscribe: e-mail to [hidden email]
--
Start a FREE E-Mail List at http://www.MakeList.com !

Reply | Threaded
Open this post in threaded view
|

Re: [netrexx-course] Lesson 1?

dIon Gillard/Multitask Consulting/AU
On Tue, 11 Aug 98 08:28:47, J. Pedone wrote:

|   On Mon, 10 Aug 1998 15:41:48 +1000, dIon Gillard wrote:
|  
|   >Feedback anyone??
|   >
|  
|   Excellent intro - I'm trying to figure out how to implement runnable in
|   a semi-useful way at the moment. Any suggestions :-)

Sure....what do you want to do???

A simple example:

class NotReallyUseful implements Runnable

method run
        Say "Do stuff here"

To use this class:

class UsesUseless

method main(arg=String[]) static
        -- create a thread using the not really useful runnable
        t = Thread(NotReallyUseful())
        -- start the thread running in parallel
        t.start


Does this help??

dIon Gillard, Sun Certified Java 1.1 Programmer
Work: http://www.multitask.com.au/ | NetRexx: http://www.multitask.com.au/netrexx/
VisualNetRexx: http://www.trongus.com/VisualNetRexx/




----
List Archive: http://www.FindMail.com/list/netrexx-course/ 
To Subscribe: e-mail to [hidden email]
To Unsubscribe: e-mail to [hidden email]
--
Start a FREE E-Mail List at http://www.MakeList.com !

Reply | Threaded
Open this post in threaded view
|

Re: [netrexx-course] Lesson 1?

Michel Plungjan-3
In reply to this post by dIon Gillard/Multitask Consulting/AU


dIon Gillard wrote:

> Feedback anyone??

Sorry dIon - just came back from holiday and had to wade through 110 non-spam emails -
I also need to move my stuff from one pc to another (nightmare time) before I can
install Java and NetRexx - I sincerely appreciate the effort and will definitely
absorbe it while my boss is on holiday.

Thanks again,

Michel



----
List Archive: http://www.FindMail.com/list/netrexx-course/ 
To Subscribe: e-mail to [hidden email]
To Unsubscribe: e-mail to [hidden email]
--
Start a FREE E-Mail List at http://www.MakeList.com !

Reply | Threaded
Open this post in threaded view
|

Re: [netrexx-course] Lesson 1?

J. Pedone
In reply to this post by dIon Gillard/Multitask Consulting/AU
On Mon, 10 Aug 1998 15:41:48 +1000, dIon Gillard wrote:

>Feedback anyone??
>

Excellent intro - I'm trying to figure out how to implement runnable in
a semi-useful way at the moment. Any suggestions :-)

j.



[hidden email]
http://www.flash.net/~jpedone



----
List Archive: http://www.FindMail.com/list/netrexx-course/ 
To Subscribe: e-mail to [hidden email]
To Unsubscribe: e-mail to [hidden email]
--
Start a FREE E-Mail List at http://www.MakeList.com !

Reply | Threaded
Open this post in threaded view
|

Re: [netrexx-course] Lesson 1?

Terry Norton-2
In reply to this post by dIon Gillard/Multitask Consulting/AU
On Tue, 11 Aug 1998 00:42:15 +1000, dIon Gillard wrote:

>A simple example:
>
>class NotReallyUseful implements Runnable
>
>method run
> Say "Do stuff here"
>
>To use this class:
>
>class UsesUseless
>
>method main(arg=String[]) static
> -- create a thread using the not really useful runnable
> t = Thread(NotReallyUseful())
> -- start the thread running in parallel
> t.start
>
>
>Does this help??

Not me.  I simply don't understand why things are done they way
they are.

For instance, you created a class NotReallyUseful to use the Run
method in Runnable, then you end up creating a totally different
class, UsesUseless, to use NotReallyUseful.

Is this the main idea of OO, that each thing you want to do is
put in an object (class), then use all these assorted objects
(classes) in the main program (which is also a class)?

What really confuses me is this abstract concept.  What is the
point of creating a class that isn't really complete?


Terry Norton
Warped with OS/2



----
List Archive: http://www.FindMail.com/list/netrexx-course/ 
To Subscribe: e-mail to [hidden email]
To Unsubscribe: e-mail to [hidden email]
--
Start a FREE E-Mail List at http://www.MakeList.com !

Reply | Threaded
Open this post in threaded view
|

Re: [netrexx-course] Lesson 1?

J. Pedone
In reply to this post by dIon Gillard/Multitask Consulting/AU
On Tue, 11 Aug 1998 00:42:15 +1000, dIon Gillard wrote:

>On Tue, 11 Aug 98 08:28:47, J. Pedone wrote:
>
>|   On Mon, 10 Aug 1998 15:41:48 +1000, dIon Gillard wrote:
>|  
>|   >Feedback anyone??
>|   >
>|  
>|   Excellent intro - I'm trying to figure out how to implement runnable in
>|   a semi-useful way at the moment. Any suggestions :-)
>
>Sure....what do you want to do???
>

Mainly just play with it.  Thanks for the API pointer BTW that's what I
was missing.  The problem I had was in not knowing how to construct run

Anyway this is what I was playing with:

class test2 extends Applet implements runnable
properties public static
flipper = int "1"
outString = Rexx "Hello from test2"

method init
        resize(200, 200)
say "init done"

method run
        if flipper then do
                flipper = 0
        end
        else do
                flipper = 1
        end
say "run done"

method paint(p=graphics)
        p.drawString(outString, 10,10)
        t = thread(test2())
        t.start
        outString = "Hello from test2 --  flipper is now "||flipper
say "paint done"


So.. when all is said and done I guess a method is the smallest
semi-independent object but it will inherit the properties of all the
bigger objects it's contained in.  Also, and there are at least 4 entry
points to a class:

1.  Direct call i.e. xlasses.xurl()
2.  If it's an applet it defaults to init()
3.  If it's a thread the default is run()
4.  If it's a program the default is main()

What was surprising is what I did not have to do -- Put the methods in
run order, explicitly call them, explicitly stop them or pass variables
among them.  I also expected to have a million threads running since I
never kill them but this was taken care of as well.

j.



[hidden email]
http://www.flash.net/~jpedone



----
List Archive: http://www.FindMail.com/list/netrexx-course/ 
To Subscribe: e-mail to [hidden email]
To Unsubscribe: e-mail to [hidden email]
--
Start a FREE E-Mail List at http://www.MakeList.com !

Reply | Threaded
Open this post in threaded view
|

Re: [netrexx-course] Lesson 1?

bob.keller
Hi Terry,

The idea behind creating an abstract class is to define a common API.
For example, let's say you have a class called SORT which is defined has
abstract methods. (API=Application Programming Interface)

A Class called BubbleSort might extend SORT and implement those abstract
methods.
A Class called ShellSort might extend SORT and implement the same
abstract methods with a different algorithm.

In general OO programming is a bottom up programming philosophy where
you start with "components" (objects) and merge them together to create
a cohesive (theoretically) whole. The idea behind OO is to ,as much as
possible, re-use objects in multiple programs.

I don't know what manuals you have but you might check out "The Java
Class Libraries Second Edition
Volume 1". It shows the class relationships with examples (in Java) for
the Java Core Libraries.

Don't feel bad that you're confused about this stuff. It takes awhile to
figure out how it all plays together.
I was lost for a couple of months or so myself.

Regarding RUNNABLE. Yes, the way it works is you create a runnable
object then use another object to call it.

A use for this might be to read in multiple files prior to processing.
If you read them one at a time, it takes longer, but if you could read
them in a multi-threaded manner, the processing will (possibly) take
less time.

I hope this helps a little.

Best  Regards,

Bob <:-)>

> -----Original Message-----
> From: Terry Norton [SMTP:[hidden email]]
> Sent: Tuesday, August 11, 1998 11:38 AM
> To: [hidden email]
> Subject: Re: [netrexx-course] Lesson 1?
>
> On Tue, 11 Aug 1998 00:42:15 +1000, dIon Gillard wrote:
>
> >A simple example:
> >
> >class NotReallyUseful implements Runnable
> >
> >method run
> > Say "Do stuff here"
> >
> >To use this class:
> >
> >class UsesUseless
> >
> >method main(arg=String[]) static
> > -- create a thread using the not really useful runnable
> > t = Thread(NotReallyUseful())
> > -- start the thread running in parallel
> > t.start
> >
> >
> >Does this help??
>
> Not me.  I simply don't understand why things are done they way
> they are.
>
> For instance, you created a class NotReallyUseful to use the Run
> method in Runnable, then you end up creating a totally different
> class, UsesUseless, to use NotReallyUseful.
>
> Is this the main idea of OO, that each thing you want to do is
> put in an object (class), then use all these assorted objects
> (classes) in the main program (which is also a class)?
>
> What really confuses me is this abstract concept.  What is the
> point of creating a class that isn't really complete?
>
>
> Terry Norton
> Warped with OS/2
>
>
>
> ----
> List Archive: http://www.FindMail.com/list/netrexx-course/ 
> To Subscribe: e-mail to [hidden email]
> To Unsubscribe: e-mail to [hidden email]
> --
> Start a FREE E-Mail List at http://www.MakeList.com !


----
List Archive: http://www.FindMail.com/list/netrexx-course/ 
To Subscribe: e-mail to [hidden email]
To Unsubscribe: e-mail to [hidden email]
--
Start a FREE E-Mail List at http://www.MakeList.com !

Reply | Threaded
Open this post in threaded view
|

Re: [netrexx-course] Lesson 1?

dIon Gillard/Multitask Consulting/AU
In reply to this post by J. Pedone




On Tue, 11 Aug 1998 00:42:15 +1000, dIon Gillard wrote:

>>A simple example:
>>
>>class NotReallyUseful implements Runnable
>>
>>method run
>>      Say "Do stuff here"
>>
>>To use this class:
>>
>>class UsesUseless
>>
>>method main(arg=String[]) static
>>      -- create a thread using the not really useful runnable
>>      t = Thread(NotReallyUseful())
>>      -- start the thread running in parallel
>>      t.start
>>
>>
>>Does this help??

> Not me.  I simply don't understand why things are done they way
> they are.

> For instance, you created a class NotReallyUseful to use the Run
> method in Runnable, then you end up creating a totally different
> class, UsesUseless, to use NotReallyUseful.

I could have done it in one class. I just separated them to give you a
clear example of implementing runnable, rather than using a Runnable, e.g.:

class NotReallyUseful implements Runnable

method run
        Say "Do stuff here"

method main(arg=String[]) static
        -- create a thread using the not really useful runnable
        t = Thread(NotReallyUseful())
        -- start the thread running in parallel
        t.start


> Is this the main idea of OO, that each thing you want to do is
> put in an object (class), then use all these assorted objects
> (classes) in the main program (which is also a class)?

This one gets back to OO design.

A single object should provide a clear set of services, working on the same
set of data.


So this Runnable, without having some predefined purpose to it, it's hard
to say. In the case of the main method, that's just there to run it from
the command prompt, so to make life easy, it can go anywhere you want.

> What really confuses me is this abstract concept.  What is the
> point of creating a class that isn't really complete?

The idea of an abstract class is for example a bank that has Savings
Accounts, Cheque Accounts, Loan Accounts etc. To hold all the common code
between the 3 types of accounts, typically you'd create an 'Account' class
that was abstract.

You couldn't create an 'Account' object - that makes no sense, you'd have
to create a Cheque, Savings or Loan extension of account. But the three
classes can inherit from Account, and inherit common behaviour and
properties, for example the accountNumber property would be common between
all three, as would customer info, and the ability to deposit money.

So you'd have any account a customer could open as a subclass of the
abstract Account class. The Account class would provide the common, basic
functionality for all types of accounts.

Does this make it clearer??





----
List Archive: http://www.FindMail.com/list/netrexx-course/ 
To Subscribe: e-mail to [hidden email]
To Unsubscribe: e-mail to [hidden email]
--
Start a FREE E-Mail List at http://www.MakeList.com !

Reply | Threaded
Open this post in threaded view
|

Re: [netrexx-course] Lesson 1?

dIon Gillard/Multitask Consulting/AU
In reply to this post by dIon Gillard/Multitask Consulting/AU



> Mainly just play with it.  Thanks for the API pointer BTW that's what I
> was missing.  The problem I had was in not knowing how to construct run
No problems...

> Anyway this is what I was playing with:

> So.. when all is said and done I guess a method is the smallest
> semi-independent object but it will inherit the properties of all the
> bigger objects it's contained in.  Also, and there are at least 4 entry
> points to a class:
The method is the unit of code. i.e. a programmer writes methods inside of
a class.

> 1.  Direct call i.e. xlasses.xurl()
I'm assuming this is the constructor. An object's life cycle is:
constructor. There is no way to explicitly destroy an object in Java.

> 2.  If it's an applet it defaults to init()
This is part of the applet lifecycle - constructor, init, start, stop,
destroy

> 3.  If it's a thread the default is run()
Part of a thread's life cycle: A thread only ever uses a Runnable's run
method.

> 4.  If it's a program the default is main()
Yep, part of a program's life cycle.

Servlets have another life cycle. Each type of executable object (one that
will be run in a particlular way) has a well defined lifecycle.

> What was surprising is what I did not have to do -- Put the methods in
> run order, explicitly call them, explicitly stop them or pass variables
> among them.  I also expected to have a million threads running since I
> never kill them but this was taken care of as well.
The thread ends when the run method is complete. One of the nice things
about Java, and hence NetRexx is that it removes some of the need to
clean-up from the programmer - we can't be trusted :)



----
List Archive: http://www.FindMail.com/list/netrexx-course/ 
To Subscribe: e-mail to [hidden email]
To Unsubscribe: e-mail to [hidden email]
--
Start a FREE E-Mail List at http://www.MakeList.com !

Reply | Threaded
Open this post in threaded view
|

Re: [netrexx-course] Lesson 1?

Terry Norton-2
In reply to this post by dIon Gillard/Multitask Consulting/AU
On Tue, 11 Aug 1998 14:32:39 -0700, [hidden email] wrote:

>The idea behind creating an abstract class is to define a common API.
>For example, let's say you have a class called SORT which is defined has
>abstract methods. (API=Application Programming Interface)
>
>A Class called BubbleSort might extend SORT and implement those abstract
>methods.
>A Class called ShellSort might extend SORT and implement the same
>abstract methods with a different algorithm.

Using your SORT example

So it allows every programmer to start from the same point so
that there aren't millions of different versions created by
millions of programmers.  Right?  We get to decide what's going
to be actually done with the method since we finish the code.

I believe a lot of my confusion deals with the fact that
everything is a class.


Terry Norton
Warped with OS/2



Terry Norton
Claims Center Solutions
[hidden email]
Warped with OS/2

____________________________________________________________________
Get free e-mail and a permanent address at http://www.amexmail.com/?A=1


----
List Archive: http://www.FindMail.com/list/netrexx-course/ 
To Subscribe: e-mail to [hidden email]
To Unsubscribe: e-mail to [hidden email]
--
Start a FREE E-Mail List at http://www.MakeList.com !

Reply | Threaded
Open this post in threaded view
|

Re: [netrexx-course] Lesson 1?

bob.keller
In reply to this post by dIon Gillard/Multitask Consulting/AU
Hi Terry,

Yep, you get the idea. You can also extend an objects methods that are
not abstract (and not declared final)  thus overriding the default
behavior so that you can test new algorithms etc.    

Best Regards,

Bob <:-)>


> -----Original Message-----
> From: Terry Norton [SMTP:[hidden email]]
> Sent: Wednesday, August 12, 1998 4:19 AM
> To: [hidden email]
> Subject: Re: [netrexx-course] Lesson 1?
>
> On Tue, 11 Aug 1998 14:32:39 -0700, [hidden email] wrote:
>
> >The idea behind creating an abstract class is to define a common API.
> >For example, let's say you have a class called SORT which is defined
> has
> >abstract methods. (API=Application Programming Interface)
> >
> >A Class called BubbleSort might extend SORT and implement those
> abstract
> >methods.
> >A Class called ShellSort might extend SORT and implement the same
> >abstract methods with a different algorithm.
>
> Using your SORT example
>
> So it allows every programmer to start from the same point so
> that there aren't millions of different versions created by
> millions of programmers.  Right?  We get to decide what's going
> to be actually done with the method since we finish the code.
>
> I believe a lot of my confusion deals with the fact that
> everything is a class.
>
>
> Terry Norton
> Warped with OS/2
>
>
>
> Terry Norton
> Claims Center Solutions
> [hidden email]
> Warped with OS/2
>
> ____________________________________________________________________
> Get free e-mail and a permanent address at
> http://www.amexmail.com/?A=1
>
>
> ----
> List Archive: http://www.FindMail.com/list/netrexx-course/ 
> To Subscribe: e-mail to [hidden email]
> To Unsubscribe: e-mail to [hidden email]
> --
> Start a FREE E-Mail List at http://www.MakeList.com !


----
List Archive: http://www.FindMail.com/list/netrexx-course/ 
To Subscribe: e-mail to [hidden email]
To Unsubscribe: e-mail to [hidden email]
--
Start a FREE E-Mail List at http://www.MakeList.com !

Reply | Threaded
Open this post in threaded view
|

Re: [netrexx-course] Lesson 1?

Monika Göhmann
In reply to this post by dIon Gillard/Multitask Consulting/AU
>The idea of an abstract class is for example a bank that has Savings
>Accounts, Cheque Accounts, Loan Accounts etc. To hold all the common code
>between the 3 types of accounts, typically you'd create an 'Account' class
>that was abstract.
>
>So you'd have any account a customer could open as a subclass of the
>abstract Account class. The Account class would provide the common, basic
>functionality for all types of accounts.
>


One might add an example showing a very important feature of OO I recently
learned about: polymorphism. You build a collection of the type of your
abstract class and put into it all sorts of objects from your derived
classes. The compiler/interpreter will find the correct way to handle each
member of the collection.

Below is a simple example build around the Car class from Lesson 1

-- very simple class with just one method
class AbstractCar abstract
  -- abstract method will be implemented by derived classes
  method run abstract

  -- use inner class for test-method
  class Test
    /** This method is called when java runs an object from the command
prompt*/
    method main( args=String[] ) static
      -- see class definitions of these classes below
      car1 = FastCar()    -- our first car
      car2 = SlowCar()    -- our second
      car3 = Car()        -- our third

      -- create an array of AbstractCars and put different sorts of derived
Cars
      --   (e.g. FastCar, SlowCar) into it
      carArray = AbstractCar[3]
      carArray[0] = car1
      carArray[1] = car2
      carArray[2] = car3

      -- then let NetRexx figure out, which "run" method to call for each
Car
      loop i=0 to 2
        carArray[i].run()
      end

-- there are different sorts of Cars, all based on the AbstractCar
class Car extends AbstractCar
  method run
    Say "just running"

class FastCar extends AbstractCar
  method run
    Say "running fast"

class SlowCar extends AbstractCar
  method run
    Say "running slow"






----
List Archive: http://www.FindMail.com/list/netrexx-course/ 
To Subscribe: e-mail to [hidden email]
To Unsubscribe: e-mail to [hidden email]
--
Start a FREE E-Mail List at http://www.MakeList.com !

Reply | Threaded
Open this post in threaded view
|

Re: [netrexx-course] Lesson 1?

Terry Norton-2
In reply to this post by dIon Gillard/Multitask Consulting/AU
On Wed, 12 Aug 1998 08:51:48 +1100, dIon Gillard/Multitask
Consulting/AU wrote:

>So you'd have any account a customer could open as a subclass of the
>abstract Account class. The Account class would provide the common, basic
>functionality for all types of accounts.

Referring to Bob Keller's explanation about a common API, then
essentially the bank, in your explanation, creates an abstract
account class which is in reality a common API for this
particular bank if anyone came along and wanted to do some java
(NetRexx) programming for this bank.

Now if every bank were to use this same abstract account class,
it would truly be common (standard) like Runnable.  Have I got
it?

Another question:

If I really wanted to defeat the whole OO idea when creating an
app, I could just define all my classes in one program (class)
file.  Is this also correct?  I wouldn't do this, but I just
want to use this example clear out fuzzy spots.


Terry Norton
Warped with OS/2



----
List Archive: http://www.FindMail.com/list/netrexx-course/ 
To Subscribe: e-mail to [hidden email]
To Unsubscribe: e-mail to [hidden email]
--
Start a FREE E-Mail List at http://www.MakeList.com !

Reply | Threaded
Open this post in threaded view
|

Re: [netrexx-course] Lesson 1?

dIon Gillard/Multitask Consulting/AU
In reply to this post by dIon Gillard/Multitask Consulting/AU




>So you'd have any account a customer could open as a subclass of the
>abstract Account class. The Account class would provide the common, basic
>functionality for all types of accounts.

| Referring to Bob Keller's explanation about a common API, then
| essentially the bank, in your explanation, creates an abstract
| account class which is in reality a common API for this
| particular bank if anyone came along and wanted to do some java
| (NetRexx) programming for this bank.
Exactly.

| Now if every bank were to use this same abstract account class,
| it would truly be common (standard) like Runnable.  Have I got
| it?
Again, exactly. In fact this is what IBM's San Francisco project is about.
Defining common business objects.

| Another question:

| If I really wanted to defeat the whole OO idea when creating an
| app, I could just define all my classes in one program (class)
| file.  Is this also correct?  I wouldn't do this, but I just
| want to use this example clear out fuzzy spots.
Yep. and if you were really perverse, you'd have only one program (class)
with every method you've ever written defined in it. Yick...





----
List Archive: http://www.FindMail.com/list/netrexx-course/ 
To Subscribe: e-mail to [hidden email]
To Unsubscribe: e-mail to [hidden email]
--
Start a FREE E-Mail List at http://www.MakeList.com !

Reply | Threaded
Open this post in threaded view
|

Re: [netrexx-course] Lesson 1?

John Bellatti
In reply to this post by dIon Gillard/Multitask Consulting/AU


dIon Gillard wrote:

> Feedback anyone??
>


Nice First Lesson, I'm working on it.  I've been off-line for a week, and got back on
to find a lot of discussion of classes and inheritance.  Also noted in your lesson the
mention of  Interface implementation.  I've read a book called Java Design by Peter
Coad.  This very nicely emphasizes the greater utility of Interfaces compared to Class
Inheritance.  Some of the questions raised in this week's comments seem to relate to
the dis-ease created by trying to classify objects in a hierarchy.  This is
well-founded.  Knowing a little about a subject makes it easier to create rigid
classification hierarchies (an hence inheritance).  However as a project goes on (in
time and size) more is discovered, and the class structure may become confining.  This
confinement is less if one is using Interfaces.

A metaphorical example -- I was at a meeting where a pathologist was discussing the
classification of all medical concepts.  One of his slides showed a [mathematical] set
structure of musical instruments. (I forget why).   I had the audacity to bring up
fuzzy set theory and point out that a blade of grass could be a musical instrument,
although it would never appear in his classification.  To some extent a blade of grass
contains "musical instrumentness" in addition to its "plantness".  So now along comes
JAVA  (and NetRexx)  with a much better way to express this (C++ multiple inheritance
will not do it very easily).  If you were describing this in NetRexx, the class
Blade_of_Grass could implement Musical_Instrument interface AND the Plant Interface.

Do you have any comments regarding how to appropriately choose use of Inheritance vs
Interface ?

John B



----
List Archive: http://www.FindMail.com/list/netrexx-course/ 
To Subscribe: e-mail to [hidden email]
To Unsubscribe: e-mail to [hidden email]
--
Start a FREE E-Mail List at http://www.MakeList.com !

Reply | Threaded
Open this post in threaded view
|

Re: [netrexx-course] Lesson 1?

dIon Gillard/Multitask Consulting/AU
In reply to this post by dIon Gillard/Multitask Consulting/AU


| Nice First Lesson, I'm working on it.  I've been off-line for a week, and
got back on
| to find a lot of discussion of classes and inheritance.  Also noted in
your lesson the
| mention of  Interface implementation.  I've read a book called Java
Design by Peter
| Coad.  This very nicely emphasizes the greater utility of Interfaces
compared to Class

It's a very good book....if you're learning Java, it's one of my
favourites.

| Inheritance.  Some of the questions raised in this week's comments seem
to relate to
| the dis-ease created by trying to classify objects in a hierarchy.  This
is
| well-founded.  Knowing a little about a subject makes it easier to create
rigid
| classification hierarchies (an hence inheritance).  However as a project
goes on (in
| time and size) more is discovered, and the class structure may become
confining.  This
| confinement is less if one is using Interfaces.

Definitely....I use interfaces fairly extensively, and am often explaining
why.

| JAVA  (and NetRexx)  with a much better way to express this (C++ multiple
inheritance
| will not do it very easily).  If you were describing this in NetRexx, the
class

In C++, you need pure virtual multiple inheritance and strictly stick to
it...tougher on the programmer.

| Do you have any comments regarding how to appropriately choose use of
Inheritance vs
| Interface ?
When there is some reason for inheritance, i.e. the thing must be a
graphical object, and that service is already defined as a class, you'll
have to use inheritance. ie with Applet, or Component.

When the service is not yet fixed in a hierarchy, use an interface, i.e.
with Employee it would be an interface (typically any role should be
defined as an interface). Person would be a class. Often, I create an
interface and a default implementation.

HTH



----
List Archive: http://www.FindMail.com/list/netrexx-course/ 
To Subscribe: e-mail to [hidden email]
To Unsubscribe: e-mail to [hidden email]
--
Start a FREE E-Mail List at http://www.MakeList.com !

Reply | Threaded
Open this post in threaded view
|

[netrexx-course] Re: Lesson 1?

Andreas Zieritz-2
dIon Gillard/Multitask Consulting/AU wrote:

> Definitely....I use interfaces fairly extensively, and am often explaining
> why.
 

Some time ago I bought a very good book called 'Object Rexx by Example'.
One of the first things they said was, that Examples are the most
important thing you need when you want to do something.

That's the same with me..

Could all the 'high level' programmers give us lower ones a simple
example of all you're talking about - it makes life much easier for us.

Thanks

____________________________________________________________
List Site: http://www.findmail.com/list/netrexx-course/ 
To unsubscribe, send to [hidden email]

FREE group e-mail lists at http://www.findmail.com

Reply | Threaded
Open this post in threaded view
|

[netrexx-course] Re: Lesson 1?

Tom Stevic
In reply to this post by dIon Gillard/Multitask Consulting/AU
A question.

In the HelloApplet, line 7 says:
 method paint(g=Graphics)

What exactly does the statement g=Graphics do?

_________________________________________________
TeamOS/2        RexxLA        V.O.I.C.E

"Yes, Virginia, there is a better choice."
Warpstock '98     http://www.warpstock.org


____________________________________________________________
List Site: http://www.findmail.com/list/netrexx-course/ 
To unsubscribe, send to [hidden email]

FREE group e-mail lists at http://www.findmail.com

Reply | Threaded
Open this post in threaded view
|

Re: [netrexx-course] Lesson 1?

Marshall Thompson
In reply to this post by dIon Gillard/Multitask Consulting/AU
At 03:41 PM 8/10/98 +1000, you wrote:
>Feedback anyone??
>
Hello dIon,

Thank you for an excellent first lesson. I was pleasantly surprised. It was
more than I expected and just what I was looking for. Like some of the
group, I am a passable Rexx programmer, mostly for scripting, and am just
becoming familiar with OO programming. I like the promise of NetRexx as a
user-friendly combination of Rexx & Java. You did a very nice job of making
clear explanations of some complicated concepts.
As someone else also suggested, the more examples, the better. I like
simple ones (such as the "cut out" one in Lesson 1) for illustrating
concepts, and I found the bank account example, which was in a follow-up
message, to be especially useful for it's real-worldness. Perhaps this
example could continue to be built up and expanded upon to show us relative
novices how to make a practical application with NetRexx.

Here's hoping I can find the time to practice. Thanks again.


Regards,

Marshall

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Marshall Thompson                    Stanford Linear Accelerator Center
voice: (650) 926-4231                      mailto:[hidden email]
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

____________________________________________________________
List Site: http://www.findmail.com/list/netrexx-course/ 
To unsubscribe, send to [hidden email]

FREE group e-mail lists at http://www.findmail.com

Reply | Threaded
Open this post in threaded view
|

Re: [netrexx-course] Lesson 1?

Larry Morgenweck
In reply to this post by Tom Stevic
A question.

>
> In the HelloApplet, line 7 says:
>  method paint(g=Graphics)
>
> What exactly does the statement g=Graphics do?
>
> _________________________________________________
> TeamOS/2        RexxLA        V.O.I.C.E
>
> "Yes, Virginia, there is a better choice."
> Warpstock '98     http://www.warpstock.org
>
>
> ____________________________________________________________
> List Site: http://www.findmail.com/list/netrexx-course/ 
> To unsubscribe, send to [hidden email]
>
> FREE group e-mail lists at http://www.findmail.com
>
>



-----
Original Message: http://www.findmail.com/list/netrexx-course/?start=82
Start a FREE email list at http://www.FindMail.com/

____________________________________________________________
List Site: http://www.findmail.com/list/netrexx-course/ 
To unsubscribe, send to [hidden email]

FREE group e-mail lists at http://www.findmail.com

12