• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

help on teaching OOP?

 
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Cyrus Serrano
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Sheriff
Posts: 7001
6
Eclipse IDE Python C++ Debian Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 3271
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Cyrus Serrano
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 107
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 137
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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..
 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Rene, please add a last name to your display name -- our naming policy requires it.

Thanks.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic