File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Teachers' Lounge and the fly likes help on teaching OOP? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Books » Teachers' Lounge
Bookmark "help on teaching OOP?" Watch "help on teaching OOP?" New topic
Author

help on teaching OOP?

Cyrus Serrano
Ranch Hand

Joined: Sep 29, 2003
Posts: 137
im currently teaching java, but having some difficulty on how to share OOP concepts with my students, can you help me on some analogy or resources that i can use. thanks. i wish to buy head first java, but im currently here at the philippines, and it will take 2 months before the products gets here.

thanks all
Amirthalingam Prasanna
Ranch Hand

Joined: Jan 08, 2004
Posts: 107
Hi,
If you are teaching OOP through java try using the following ide
http://www.bluej.org/download/download.html
Its specifically made to teach OOP concepts using java and it helped me a lot.


Prasanna <br />[SCJA Beta, SCJP 1.4, SCJP 5.0 Beta]<br />[MCSD, MCPD, MCT, MVP]<br /><a href="http://www.prasanna.ws" target="_blank" rel="nofollow">My Blog</a>
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Maybe step away from programming languages and work on the basic concepts of object responsibilities and message passing. Have some people "play object" and hand them messages on 3x5 cards. See if you can get several to collaborate on a simple task by message passing. Switch to speaking a simple request and tossing a ball for message passing. Introduce data late in the game!

Here are a couple papers I really liked ... the funny stories might inspire you in this game playing direction ...

http://www.surfscranton.com/architecture/KnightsPrinciples.htm
http://www.surfscranton.com/architecture/LawOfDemeter.htm


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Cyrus Serrano
Ranch Hand

Joined: Sep 29, 2003
Posts: 137
thank you for replying, i enjoyed some of the links especially on Law OF Demeter, sir i didn't understand much of Knights Principle, can you shed some light to my mind. thanks again.

I will try to play with BlueJ, thanks..


Cyrus
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Knight's stories were fun ways to explain some serious ideas. For example "Never do any work that you can get someone else to do for you" is a neat object concept. In other languages, say COBOL or C or Perl, it's tempting to write a program that solves an entire problem. It knows everything, does everything. (It's certainly possible to modularize into smaller chunks but easy to forget to.)

In good OO it's nice for a program to say exactly what it wants to do with minimal exposure of details about how it gets done. Push the tricky bits of the job off to another object. Focus on behavior - what you want that other object to do for you. And when you look inside that object you find it is doing the very same thing ... expressing its purpose or objective as clearly as possible and pushing the details off to another object.

I think one of those two papers mentions that you can carry this to absurd extremes and wind up with a cloud of little objects that appear to do nothing but call one another. I've been there - neck deep in Smalltalk code with thousands of 3-line methods that all seemed to do absolutely nothing.
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
thousands of 3-line methods that all seemed to do absolutely nothing Where I've worked we've called this "ravioli code", a spin on the well-known problems of "spaghetti code". I can only assume that this a fairly widespread term.


Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
Corey McGlone
Ranch Hand

Joined: Dec 20, 2001
Posts: 3271
Man, I remember first trying to learn OO programming. It was quite possibly the most frustrating this I've ever had to do in my short time programming. I just "didn't get it" until my Eureka! moment (which happened to be in the shower of my girlfriend's dorm - funny how you remember such things, isn't it) and then everything just made sense. I have a feeling, for most people, it's probably similar. Until you "get" OO principles, programming using them is like finding your way through a maze in the dark - you can do it, but it's more random luck than skill.

One of my most valuable examples has been to start with "real life" constructs and try to have your students describe them as objects. What data might a student have (Name, SSN, GPA, etc.) and what methods might a student perform (getName, updateGPA, takeExam, skipClass, etc.)? Then, try making a program using those objects - it can be quite contrived, if need be:



Yeah, maybe I'm just spouting useless garbage, but it makes sense to me. In addition, when it comes to inheritance and polymoprhism, I love to use animals. A Cat is an Animal and a Dog is an Animal, but a Cat is not a Dog and vice-versa. You get the idea. Animals just seem to work really well for that principle.

Anyway, maybe that helped and maybe it didn't. Best of luck.

Corey


SCJP Tipline, etc.
Cyrus Serrano
Ranch Hand

Joined: Sep 29, 2003
Posts: 137
corey,

thank you for the knowledge that you have shared, its worth it. Anyway i decided to use BlueJ, next semester. Im currently the senior instructor on teaching Java here at STI College Caloocan. And planning to expand it by the coming semester. Do you think BlueJ is good, to help my student learn OOP and Java. Do you have any sites that i can visit for more samples, though i got a copy of Head First Java, from a friend here in the Phillipines, he allowed me to have it upto late August this year, YAHOO!!

thanks again, corey.

Cyrus

PS. its really fun to read that book.
Amirthalingam Prasanna
Ranch Hand

Joined: Jan 08, 2004
Posts: 107
BlueJ is good.
I was a part time lecturer at a computer institute.So when u generally teach someone OOP concepts using java at the start itself you dont want to explain static and the use of the main method.One thing i liked about using BlueJ is the fact you can put these concepts a bit later after explaining the key concepts.(You dont need a static void main method to begin a program in BlueJ)
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Teaching tools for Java ... I've given a few seconds thought to something like:

The instructor passes out unit tests. The assignment is to make them run.

Students submit solutions - maybe a zip of a directory tree

Instructor can put solutions in a set of directories named by student id and select one at a time to run or maybe all of them.

Would need a little framework in which students run their classes (no main()!) and a variation on that for the instructor. Or maybe exactly the same code. Anybody know anything like that? Would it sound fun to build together?
Jack Kay
Ranch Hand

Joined: Aug 01, 2004
Posts: 62
I was a student in Java class, and my first impression was this:
"I hate this language! I just want to learn C#!"

But now look at me! I'm an addicted FREAK lol. Ok not freak but you know what I mean! (I hope!)

But you see I didn't know the importance, this is what you need to do as a teacher:
1) Brainwash your kids into thinking that Java is the best language.
2) Tell them it's the best paying job
3) Tell them it's where all or most of the jobs are
4) And if they want to learn C# instead of Java, tell them that's Ok, then they'll probably come back crawling because they've figured out that they need to learn Java first.

Here's a good place to get started!
http://www.trans4mind.com/spiritual/brainwashing.htm
Cyrus Serrano
Ranch Hand

Joined: Sep 29, 2003
Posts: 137
i think brainwashing is not a good idea.

since they have enrolled on this course(BSCS(, i think its a good move you tell and let your student realized what will they do( i mean the JOB), after graduating the course.

sorry for saying such..
Rene Smith
Greenhorn

Joined: Jun 10, 2004
Posts: 21
http://www.mindview.net/Books/TIJ/

Good resource - you can download the book Thinking in Java, 3rd Ed by Bruce Eckle for free.
This book finally allowed my Eurika moment.

-Joy
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Rene, please add a last name to your display name -- our naming policy requires it.

Thanks.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Dale McKinnon
Greenhorn

Joined: Oct 12, 2004
Posts: 1
One thing that I did that seemed to work out okay is I brought some aluminum cookie cutters to class and a bunch of cookies that had been cut from them then baked and decorated. I explained that the cookie cutter is like the 'class' and each cookie that it cuts is like an 'object'. Cookies inherit traits from the cutter (shape) but they can also have their own unique state (frosting color, sprinkles, etc.).

I don't know if they learned anything, but we had fun eating the objects when I was done.


Dale McKinnon<br />----oooo----�(_)�----oooo----
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: help on teaching OOP?