1. OO tutorials would be helpful

Hello,
I have looked at the Object Oriented versions that have been submitted. 
I am not  sure why I would use them. If there was a simple tutorial  
that described each line and the overall benefit that would be helpful 
in deciding which OOP to use. I hope this is helpful.
I appreciate all the efforts that have been made by everyone.
Thanks
Jvandal

new topic     » topic index » view message » categorize

2. Re: OO tutorials would be helpful

sixs wrote:
> 
> Hello,
> I have looked at the Object Oriented versions that have been submitted. 
> I am not  sure why I would use them. If there was a simple tutorial  
> that described each line... 

Whew! Not sure what you mean there. Each library? Each line of code in each 
library?

> ... and the overall benefit that would be helpful 
> in deciding which OOP to use. I hope this is helpful.
> I appreciate all the efforts that have been made by everyone.

OOP is right when your data can have a lot of different types 
with varying degrees of similarity; usual examples are car 
inventories or trash recyclers. Also, it is right when you know 
that the same concept will be implemented in different ways (for 
instance on different computers in a network) and you don't want your users 
to need to figure that out for proper operation.
For instance, you'd like to talk to a mailslot zithout caring for what the 
email client or the exact protocol is.
Otherwise its costs outwigh its benefits, unless you need/wish to reuse an 
existing interface while controlling and reengineering the code behind it.

Just my experience. OOP is right for ome kinds of projects and is not 
suitable to some others.

CChris

> Thanks
> Jvandal
> 
 
 
>

new topic     » goto parent     » topic index » view message » categorize

3. Re: OO tutorials would be helpful

Hi there,

I know what you mean.  The author usually has a good working knowledge
of the lib so they tend to skip over details that the new user has
no idea about.
With my lib (WinClass) i tried to include introductory notes and
stuff in help files but i see now that a line by line breakdown would
be very useful to people reading the file for the first time.
I dont think it would be that hard to do with short demos either.

I did include notes that shows what most of the parameters are for in
'Create' function calls.


Take care,
Al

And, good luck with your Euphoria programming!

My bumper sticker: "I brake for LED's"

new topic     » goto parent     » topic index » view message » categorize

4. Re: OO tutorials would be helpful

Hi,
I was thinking of a simple program that exists( one that reads and 
writes a file with a windows  view) and the author writing the same 
logic in the author's OOL.  An explanation of why you created  the lines 
in your OOL  to do the process
I hope this is a good idea to help people use your product.
Jim

CChris wrote:

>
>
>posted by: CChris <christian.cuvier at agriculture.gouv.fr>
>
>sixs wrote:
>  
>
>>Hello,
>>I have looked at the Object Oriented versions that have been submitted. 
>>I am not  sure why I would use them. If there was a simple tutorial  
>>that described each line... 
>>    
>>
>Whew! Not sure what you mean there. Each library? Each line of code in each 
>library?
>
>  
>>... and the overall benefit that would be helpful 
>>in deciding which OOP to use. I hope this is helpful.
>>I appreciate all the efforts that have been made by everyone.
>>    
>>
>OOP is right when your data can have a lot of different types 
>with varying degrees of similarity; usual examples are car 
>inventories or trash recyclers. Also, it is right when you know 
>that the same concept will be implemented in different ways (for 
>instance on different computers in a network) and you don't want your users 
>to need to figure that out for proper operation.
>For instance, you'd like to talk to a mailslot zithout caring for what the 
>email client or the exact protocol is.
>Otherwise its costs outwigh its benefits, unless you need/wish to reuse an 
>existing interface while controlling and reengineering the code behind it.
>
>Just my experience. OOP is right for ome kinds of projects and is not 
>suitable to some others.
>
>CChris
>
>  
>>Thanks
>>Jvandal
>>
>>    
>
>
>

new topic     » goto parent     » topic index » view message » categorize

5. Re: OO tutorials would be helpful

sixs wrote:
> 
> Hi,
> I was thinking of a simple program that exists( one that reads and 
> writes a file with a windows  view) and the author writing the same 
> logic in the author's OOL.  An explanation of why you created  the lines 
> in your OOL  to do the process
> I hope this is a good idea to help people use your product.
> Jim

Well, this is a good idea, however, in some cases, some author's might use
a diffrent API Library, then others.  But I do understand your point, that
us authors do sometimes forget, that there are thoes out there, that don't
understand what OOP is.  And therefore, don't understand how the code
actually works, just by looking at the code.  Therefore, in v1.1 of the 
POOP/P-SOOP (Whatever I decide to rename it to), there will be a basic demo
for something like this:

Normal Euphoria Code:
sequence names, ages, city, state
names = {"Bill","John","Michael"}
ages = {32,21,17}
city = {"Omaha","New York","Tuscan"}
state = {"Nebraska","New York","Arizona"}

for x = 1 to length(names) do
printf(1,"Name: %s\nAge: %d\City: %s\nState:
    %s\n\n",{names[x],ages[x],city[x],state[x]})
end for
machine_proc(26,0)


POOP/P-SOOP:
include poop.e   -- We include the library for accessing the stuff from.

Class("Person") First we declare the class 'Person'

We add these members to the Class. These will only be accessable to any class object, that is created from this class. Member("Name",SEQUENCE) This is the Person's Name Member("Age",INTEGER) This is the Person's Age Member("City",SEQUENCE) This is the City that they live in Member("State",SEQUENCE) This is the State that they live in

procedure print_out(integer fn) We're printing out to the FN given, where the person lives. printf(fn,"Name: %s\nAge: %d\nCity: %s\nState: %s\n\n",{ oget(this,"Name"),oget(this,"Age"),oget(this,"City"),oget(this,"State")}) end procedure

We add the method print to the class, so it can be accessed easily by refrence. Method("print",routine_id("print_out"))

This is where the class is constructed, and any extra stuff that is

needed to be done, will be applied here. procedure Person_Construct(sequence dat) Check to see if they passed the person's name if length(dat) >= 1 then

Store the data for later use oset(this,"Name",dat[1]) end if Check to see if they passed the person's age if length(dat) >= 2 then

EndClass()

Mario Steele http://enchantedblade.trilake.net Attaining World Dominiation, one byte at a time... }}}

new topic     » goto parent     » topic index » view message » categorize

6. Re: OO tutorials would be helpful

sixs wrote:
> 
> Hi,
> I was thinking of a simple program that exists( one that reads and 
> writes a file with a windows  view) and the author writing the same 
> logic in the author's OOL.  An explanation of why you created  the lines 
> in your OOL  to do the process
> I hope this is a good idea to help people use your product.
> Jim

Well, this is a good idea, however, in some cases, some author's might use
a diffrent API Library, then others.  But I do understand your point, that
us authors do sometimes forget, that there are thoes out there, that don't
understand what OOP is.  And therefore, don't understand how the code
actually works, just by looking at the code.  Therefore, in v1.1 of the 
POOP/P-SOOP (Whatever I decide to rename it to), there will be a basic demo
for something like this:

Normal Euphoria Code:
sequence names, ages, city, state
names = {"Bill","John","Michael"}
ages = {32,21,17}
city = {"Omaha","New York","Tuscan"}
state = {"Nebraska","New York","Arizona"}

for x = 1 to length(names) do
printf(1,"Name: %s\nAge: %d\City: %s\nState:
    %s\n\n",{names[x],ages[x],city[x],state[x]})
end for
machine_proc(26,0)


POOP/P-SOOP:
include poop.e   -- We include the library for accessing the stuff from.

Class("Person")  -- First we declare the class 'Person'
     -- We add these members to the Class.  These will only be
     -- accessable to any class object, that is created from this class.
     Member("Name",SEQUENCE)  -- This is the Person's Name
     Member("Age",INTEGER)    -- This is the Person's Age
     Member("City",SEQUENCE)  -- This is the City that they live in
     Member("State",SEQUENCE) -- This is the State that they live in

     
     procedure print_out(integer fn)
         -- We're printing out to the FN given, where the person lives.
         printf(fn,"Name: %s\nAge: %d\nCity: %s\nState: %s\n\n",{
oget(this,"Name"),oget(this,"Age"),oget(this,"City"),oget(this,"State")})
     end procedure
-- We add the method print to the class, so it can be accessed easily by
     refrence.
     Method("print",routine_id("print_out"))

     -- This is where the class is constructed, and any extra stuff that is
     -- needed to be done, will be applied here.
     procedure Person_Construct(sequence dat)
         -- Check to see if they passed the person's name
         if length(dat) >= 1 then
             -- Store the data for later use
             oset(this,"Name",dat[1])
         end if
         -- Check to see if they passed the person's age
         if length(dat) >= 2 then
             oset(this,"Age",dat[2])
         end if
         -- Check to see if they passed the person's city
         if length(dat) >= 3 then
             oset(this,"City",dat[3])
         end if
         -- Check to see if they passed the person's state
         if length(dat) >= 4 then
             oset(this,"State",dat[4])
         end if
     end procedure
     -- Assign this as the main Constructor routine for this class.
     -- More routines can be added later on, but are executed based
     -- on the order they are recived.
     Constructor(routine_id("Person_Construct"))
EndClass()

sequence people
-- Now we populate the people sequence with some Person Class instances
-- Add Bill, who's 32 from Omaha, Nebraska
people = new("Person",{"Bill",32,"Omaha","Nebraska"})
-- Add John, who's 21 from New York, New York
people &= new("Person",{"John",21,"New York","New York"})
-- And finally, Add Michael, who's 17 from Tuscan, Arizona
people &= new("Person",{"Michael",17,"Tuscan","Arizona"})

-- Loop through these, and print out their contact information to the
-- screen.
for x = 1 to length(people) do
    method_proc(people[x],"print",{1})
end for


I hope this helps out some, and if this post get's sent twice,
I'm sorry, the stupid Browser decided to click the Send Now button, before
I was finished with it. :P  Silly Browser.

Mario Steele
http://enchantedblade.trilake.net
Attaining World Dominiation, one byte at a time...

new topic     » goto parent     » topic index » view message » categorize

7. Re: OO tutorials would be helpful

I think a great test would be to take Mario Steele's "Demo3.exw" and modify
it to work with all the OOP libraries out there. That would be a good
comparison.

-=ck
"Programming in a state of EUPHORIA."
http://www.cklester.com/euphoria/

new topic     » goto parent     » topic index » view message » categorize

8. Re: OO tutorials would be helpful

cklester wrote:
> 
> I think a great test would be to take Mario Steele's "Demo3.exw" and modify
> it to work with all the OOP libraries out there. That would be a good
> comparison.

Wow, really?  The only reason why I did Demo3.exw, was to show off POOP's
ability
to do method_id()'s to solve the age old problem, of assigning 'this' properly
for
methods, to be useful in a Full Object Oriented Enviroment.  But I guess your
right, you could do it that way.  I'm proabbly gonna update that here shortly.

He He He


Mario Steele
http://enchantedblade.trilake.net
Attaining World Dominiation, one byte at a time...

new topic     » goto parent     » topic index » view message » categorize

9. Re: OO tutorials would be helpful

sixs wrote:
> 
> Hello,
> I have looked at the Object Oriented versions that have been submitted. 
> I am not  sure why I would use them. If there was a simple tutorial  
> that described each line and the overall benefit that would be helpful 
> in deciding which OOP to use. I hope this is helpful.
> I appreciate all the efforts that have been made by everyone.
> Thanks
> Jvandal
> 

A couple of years ago I wrote "A Beginner's Guide to Object Oriented
Programming in Euphoria Using Diamond Lite" and submitted it to the User
Contributions. It dealt with concepts and techniques relevant to OOP - 
admittedly in connection with Diamond Light. You might find that useful.

Alex Caracatsanis

new topic     » goto parent     » topic index » view message » categorize

10. Re: OO tutorials would be helpful

Alex Caracatsanis wrote:
> 
> A couple of years ago I wrote "A Beginner's Guide to Object Oriented
> Programming in Euphoria Using Diamond Lite" and submitted it to the User
> Contributions. It dealt with concepts and techniques relevant to OOP - 
> admittedly in connection with Diamond Light. You might find that useful.

Alex, I did find that useful when I read it a while back. It is very
comprehensive and well done. I'd recommend it to anybody who's interested
in doing OOP with any program, not just Euphoria.

-=ck
"Programming in a state of EUPHORIA."
http://www.cklester.com/euphoria/

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu