.com.unity Forums
  The Official e-Store of Shrapnel Games

This Month's Specials

Raging Tiger- Save $9.00
winSPMBT: Main Battle Tank- Save $5.00

   







Go Back   .com.unity Forums > Shrapnel Community > Space Empires: IV & V

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #14  
Old November 30th, 2001, 04:02 PM
dogscoff's Avatar

dogscoff dogscoff is offline
General
 
Join Date: Mar 2001
Location: UK
Posts: 4,245
Thanks: 0
Thanked 0 Times in 0 Posts
dogscoff is on a distinguished road
Default Re: OT - Kind of

Classes and OO design:

As I understand it (I've studied programming but never really done any) OO design is diferent from regular programming design because:

In regular programs, you set up a system with a bunch of rules to govern how the things within in that system behave. Then you drop a load of itms into that system and the system looks after them. For example, you might make a menu screen, and the menu checks constantly to see whether one of it's buttons has been clicked and what to do if it has.

In object oriented (w00p!) design you set up a bunch of classes, with their own rules about how they interact with on another and the system they live in. Those classes then spawn objects (A class is essentially just a blueprint for an object) into the system, and you just sit back and watch them interact with one another like a little ecosystem. In the menu example, each button would be an object. (probably all from the same class) Each button would watch out for it's own mouse clicks, and store it's own information about what to do when it is pressed.

Of course it's never as easy as I make it sound...

Anyway, the advantage is that an object within a system is by definition smaller and less complex than the system itself. Therefore, it's easier to capture and define all the possible permutations and interactions for that object than for a system. This means you can break your code down into (relatively) simple and (utterly)self containd parts.

Furthermore, because objects are treated as self contained and completely independent of outside intererence, it's easy to add, remove, replace and alter them to/ from/ within your program.
As long as its interfaces remain unchanged, you can just pull it out, make whatever changes you need to within it and then drop it back in without fear of generating some seemingly random error on the other side of your software.

Or something.

*Dogscoff skulks back to his pint.
Reply With Quote
 

Bookmarks


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 06:09 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.