Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- FiveWin 1.9.2 - January 97 - <b>9.4 developing business oops-based applications</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 9.4 Developing business OOPS-based applications
--------------------------------------------------------------------------------

 Based on the fact that FiveWin integrates its own Object Oriented Engine,
 it gives you the freedom to create all the new classes you may need so you
 have the real capability to create truly OOP based applications.

 The main advantadge of coding using OOP is that our applications increase very
 much in modularity, so they are better structured and you will be able to code
 much more keeping a much better and simpler organization.

 How can you properly code in OOP ? The key for it is to be able to recognize
 'objects' in your code. And only through practise you will be able to
 easily recognize those objects. Once you start recognizing those objects,
 your code will be turning more and more OOP.

 How can you recognize an Object ? Look at the variables you are using.
 If some variables are clearly related to different aspects of the 'same',
 there is a high probability that there is an object there:

    local cLastName, cAddress, nAge

 Now, you realize they all belong to a customer, so you create a new
 TCustomer Class:

   CLASS TCustomer

      DATA cLastName, cAddress, nAge

      ...

   ENDCLASS

 So, your code changes into:

    local oCustomer := TCustomer():New()

 And you will do:

   oCustomer:cLastName = ...
   oCustomer:cAddress  = ...
   oCustomer:nAge      = ...

 You have recognized an object, and your code is simpler now.

 Now, you will be able to recognize several actions that are performed
 on TCustomers objects. Those different actions may become METHODs:

                                  CLASS TCustomer

                                     DATA cLastName, cAddress, nAge

 function NewCustomer()   --->       METHOD New()

 function EditCustomer()  --->       METHOD Edit()

 function DelCustomer()   --->       METHOD Del()

                                  ENDCLASS


Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson