Difference between revisions of "Object Oriented Programming"

esse quam videri
Jump to: navigation, search
(See also)
 
(54 intermediate revisions by 4 users not shown)
Line 1: Line 1:
[[Category:IAM Classes]]
 
=Programming Object Oriented Programming=
 
<p>syntax highlighting works like a champ now... All good to go I still feel wierd using a php wiki to teach a c# class... oh well</p>
 
the old site is at http://iam.colum.edu/oop
 
  
[[OOP Sylabus]]
+
=Definition=
  
==Classes==
+
=Relevance=
*[[OOP Class1]]
 
*[[OOP Class2]]
 
  
==Syntax Highlighting Test==
 
===Java===
 
<java> /*
 
  
* Algernon - a rule-based inference engine in Java.
 
* http://algernon-j.sourceforge.net/
 
*
 
* This example shows how to open a Protege knowledge base
 
* in Java and use Algernon to query the KB.
 
*
 
* To run it, be sure to change the path in NEWSPAPER_PROJECT
 
* to match the correct project on your system.
 
*
 
* Micheal Hewett
 
* 05 May 2004
 
* hewett@cs.stanford.edu
 
*/
 
  
package org.algernon.test;
+
=Explanation=
  
import java.util.*;
 
</java>
 
  
===cpp===
+
==Benefits of Object Oriented Programming==
<cpp> /*
 
  
* Algernon - a rule-based inference engine in Java.
+
Object Oriented Programming was made for humans by humans to help deal with the complex, irrational, rigid system that is the computer. Object Oriented languages don't benefit the machine very much but they do benefit the humans that need to program the machine.  
* http://algernon-j.sourceforge.net/
 
*
 
* This example shows how to open a Protege knowledge base
 
* in Java and use Algernon to query the KB.
 
*
 
* To run it, be sure to change the path in NEWSPAPER_PROJECT
 
* to match the correct project on your system.
 
*
 
* Micheal Hewett
 
* 05 May 2004
 
* hewett@cs.stanford.edu
 
*/
 
  
package org.algernon.test;
+
*Ease of maintenance :
 +
**no more file new project most code need to be maintained for long period of time. This gets even more difficult with many authors. It's very rare to hit file-> new project in the real world
 +
*Extend-ability
 +
**Flexible modular clean code lasts much longer. We will make a new project every week but solutions and projects are often used in a modular fashion. Groups of '''loosely coupled objects''' are one of the goals in object oriented programming
 +
*Re-usability
 +
**Once a problem has been solved with OOP the solution can often be reused over and over again. One of you goals is to keep code DRY
 +
***'''D'''on't (or at least try not to)
 +
***'''R'''epeat
 +
***'''Y'''ourself
 +
**of course this concept can be stifling to beginning programmers so we will also try to adhere to the [https://people.apache.org/~fhanik/kiss.html K.I.S.S principal]
  
import java.util.*;
+
=Resources=
</cpp>
+
== See also ==
  
 +
* [[Object Oriented Programming I | 2014 OOP I Class Site]]
  
===csharp===
+
==Notes==
<csharp>
 
using System;
 
  
  
public class Person : System.Web.UI.Page
+
==External Links==
  
{
+
[http://www.archive.org/details/arsdigitac04 Object-Oriented Program Design and Software Engineering]
    private string name;
+
http://www.codeproject.com/cpp/oopuml.asp OOP and UML
    private int age;
 
    private string sign;
 
   
 
    public Person()
 
    {
 
        sign = "cancer";
 
    }
 
   
 
    public Person(string newName)
 
    {
 
        name = newName;
 
        sign = "cancer"
 
    }
 
   
 
    public Person(string newName, string newSign )
 
    {
 
        name = newName;
 
        sign = newSign;
 
    }
 
   
 
    public string Name
 
    {
 
        get
 
        {
 
            return name;
 
        }
 
        set
 
        {
 
            name = value;
 
        }
 
    }
 
   
 
    public int Age
 
    {
 
        get
 
        {
 
            return age;
 
        }
 
        set
 
        {
 
            age = value;
 
        }
 
    }
 
   
 
    public string Sign
 
    {
 
        get
 
        {
 
            return sign;
 
        }
 
        set
 
        {
 
            sign = value;
 
        }
 
    }
 
   
 
    public string About()
 
    {
 
        string about = "";
 
       
 
        about +=(The persons name is " + this.name + ".");
 
        about +=(The person is " + this.age + " years old.");
 
        about +=(He/She's sign is " + this.sign + ".");
 
       
 
    return about;
 
    }
 
   
 
}
 
</csharp>
 
  
=== Perl ===
+
[[Category:Programming Language Concepts]]
<perl>
+
[[Category:Object Oriented Programming]]
#!/usr/local/bin/perl5.8.2
+
[[Category:C Sharp]]
#envia un correo a account_for_backups@gmail.com como usuario wickle con el backup de las
 
#ultimas base de datos de wickle y con el label Backup
 
#Usa Mail::Webmail::Gmail en #http://search.cpan.org/dist/Mail-Webmail-Gmail/lib/Mail/Webmail/Gmail.pm
 
#Syntax ./send_gmail.pl file_to_backup.tar.gz
 
 
 
use Mail::Webmail::Gmail;
 
 
 
my $backup_label="Backups";
 
my $file_to_backup=$ARGV[0];
 
my $mail_to_backup="account_for_backups@gmail.com";
 
my $now = localtime time;
 
print "It is now $now.\nfile to backup: $file_to_backup\n";
 
my ( $gmail ) = Mail::Webmail::Gmail->new(
 
            username => 'mygmailaccount', password => 'mypassword', );
 
    my $msgid = $gmail->send_message( to => 'account_for_backups@gmail.com', subject => 'Backup bases de datos '. $now, msgbody => 'Backup del dia '.$now. ' realizado', file0 => [$file_to_backup] );
 
    print "Msgid: $msgid\n";
 
    if ( $msgid ) {
 
        if ( $gmail->error() ) {
 
            print $gmail->error_msg();
 
        } else {
 
                ### Add this label to our new message ###
 
                $gmail->edit_labels( label => $backup_label, action => 'add', 'msgid' => $msgid );
 
                if ( $gmail->error() ) {
 
                    print $gmail->error_msg();
 
                } else {
 
                    print "Added label: $backup_label to message $msgid\n";
 
                }
 
        }
 
    }
 
</perl>
 

Latest revision as of 17:49, 10 June 2019

Definition

Relevance

Explanation

Benefits of Object Oriented Programming

Object Oriented Programming was made for humans by humans to help deal with the complex, irrational, rigid system that is the computer. Object Oriented languages don't benefit the machine very much but they do benefit the humans that need to program the machine.

  • Ease of maintenance :
    • no more file new project most code need to be maintained for long period of time. This gets even more difficult with many authors. It's very rare to hit file-> new project in the real world
  • Extend-ability
    • Flexible modular clean code lasts much longer. We will make a new project every week but solutions and projects are often used in a modular fashion. Groups of loosely coupled objects are one of the goals in object oriented programming
  • Re-usability
    • Once a problem has been solved with OOP the solution can often be reused over and over again. One of you goals is to keep code DRY
      • Don't (or at least try not to)
      • Repeat
      • Yourself
    • of course this concept can be stifling to beginning programmers so we will also try to adhere to the K.I.S.S principal

Resources

See also

Notes

External Links

Object-Oriented Program Design and Software Engineering http://www.codeproject.com/cpp/oopuml.asp OOP and UML