English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I can create windows applications in Java and C Sharp but I don't understand Object Orientated programming and how classes and methods work etc

Given that I already understand how to create basic applications and understand most of the syntax how much more work is it to understand the Object Orientated part?

2007-09-23 00:29:30 · 6 answers · asked by Anonymous in Computers & Internet Programming & Design

6 answers

OOP uses the same coding techniques than Sequential Programming. (SP)
You have to approach it with another mind, but there is no difference in coding, just A DIFFERENCE IN LOGICAL THINKING.
SP was the initial programming technique: The program starts AT THE START (seems silly to say that, but the program has one entry point only.) The processor then read an instruction and performs it. Then it reads THE NEXT and executes it. Then it read the next and executes it. and so on. That is sequencial programming.
(This sequence could be interrupted by an "interrupt", to stop the current execution, jump to another routine - The "Interrupt" routine - executes it, then return to the main program where it left it.)
In our modern times, the processors are able to do "multi-tasking": doing more than one thing at the same time (not really true, but it looks like it).
So, an OOP contains a lot of small INDEPENDANT "functions". There is still a "start point", when you load the program.
After that, the processor stays in a "loop", waiting for "EVENTS". Events can be anything: a key-press, a mouse movement, an incomming message, a hardware interrupt: anything, really!
The "event" triggers the running of a routine (the "object"), and the routines starts to run.
DURING that run, another event may occur: it triggers the running of another routine, and now, we "appear" to have two routines running at the same time. (again, not exactly true: the processor still executing ONE instruction at a time, but it does one of the first routine, then one of the second and so on, so it appears to be simultaneous).
So, in OOP, you don't think it terms of "sequence": you think that ALL your routines CAN be running at once!
THAT is the difficult bit, because one routine may change a "global value" WHILE the other routine expects that value to be constant!
Each of your routines is a different person, and all of them want to speak at the same time! (remind you some heated pub discussions?)
Good luck

2007-09-23 00:58:50 · answer #1 · answered by just "JR" 7 · 0 0

Not very difficult. Object Oriented Programming (OOP) was created to help programmers model the way the real world works.

So, instead of writing 30 functions in 5 modules (or header files or whatever), and then trying to figure out how they work, you put the functionality in relevant classes, which hold attributes and methods that define the behavior of an object.

For example, say you have a gradebook application. It needs to keep track of students and their grades. In OOP, you write out potential objects in the system. Nouns become classes, while verbs become methods in those classes.

In our case, a student is a noun, while tallying the final results is a verb. "Student" becomes an object. Other objects might be a "Test" object, a "Grade" object, a "Course" object, etc.

As for materials, there are tons out there.

Start with Wikipedia:

en.wikipedia.org/wiki/Object-oriented_programming

Then explore their links.

If you buy any books, look for the Deitel series (they have them for Java, C++, and C#). OOP is covered in depth in those books.

Apress also has a great book on OOP:

http://www.apress.com/book/view/1590595408

Hope this all helps.

2007-09-23 04:25:39 · answer #2 · answered by Big John Studd 7 · 0 0

Since you are already familiar with basic applications and the syntax involved. No. My suggestion would be you start with VB. It is extremely user friendly and there are several tutorials.

I would however suggest you purchase a book and work through it.

Programming with Microsoft Visual Basic 2005 is my recommendation. (Diane Zak)

Once you purchase the book you can download files from http://www.course.com that have content to work thru. I think you will enjoy the concept of OOP.

good luck

mavin

2007-09-23 00:37:20 · answer #3 · answered by mavinakdel 4 · 0 0

Not much work involved since it's an abstract concept. I suggest reading Cay Horstmann's Big Java, which helped me. Just read the first few chapters and do all the exercises. His code helps a lot as it's very object oriented. If you can't find it at your local library just buy it, it's only $35.

Don't go near Deitel's books. They teach OOP in later chapters and even then don't explain it well or incorporate it into their code as well as Horstmann does.

2007-09-23 00:36:52 · answer #4 · answered by Anonymous · 0 0

When I was in school I was pathetic at French. The older I got the simpler the language became. My problem was trying to speak French while thinking English. I am now a senior and realize how really dumb I was not to learn when learning is easier. I am lucky to live in Canada where you can always find a French speaking Canadian to speak with. It makes a huge difference. Find a chat buddy and try French immersion. Bon Chance.Bon courage.

2016-05-21 06:22:38 · answer #5 · answered by ? 3 · 0 0

Check out visual basic a piece of piss to get to grips with

2007-09-23 00:33:55 · answer #6 · answered by Anonymous · 0 1

fedest.com, questions and answers