Difference between revisions of "Object Oriented Programming"

esse quam videri
Jump to: navigation, search
(See also)
 
(56 intermediate revisions by 4 users not shown)
Line 1: Line 1:
[[Category:IAM Classes]]
 
=Programming Object Oriented Programming=
 
<p>I can't get syntax highlight to work in the wiki bahhh</p>
 
please see http://iam.colum.edu/oop
 
  
works now
+
=Definition=
  
[[OOP Sylabus]]
+
=Relevance=
  
==Classes==
 
*[[OOP Class1]]
 
*[[OOP Class2]]
 
  
==Syntax Highlighting Test==
 
===Java===
 
<java> /*
 
  
* Algernon - a rule-based inference engine in Java.
+
=Explanation=
* 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;
 
  
import java.util.*;
+
==Benefits of Object Oriented Programming==
</java>
 
  
===cpp===
+
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.
<cpp> /*
 
  
* Algernon - a rule-based inference engine in Java.
+
*Ease of maintenance :
* http://algernon-j.sourceforge.net/
+
**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
* This example shows how to open a Protege knowledge base
+
**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
* in Java and use Algernon to query the KB.
+
*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
* To run it, be sure to change the path in NEWSPAPER_PROJECT
+
***'''D'''on't (or at least try not to)
* to match the correct project on your system.
+
***'''R'''epeat
*
+
***'''Y'''ourself
* Micheal Hewett
+
**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]
* 05 May 2004
 
* hewett@cs.stanford.edu
 
*/
 
  
package org.algernon.test;
+
=Resources=
 +
== See also ==
  
import java.util.*;
+
* [[Object Oriented Programming I | 2014 OOP I Class Site]]
</cpp>
 
  
 +
==Notes==
  
===csharp===
 
<csharp>
 
using System;
 
  
 +
==External Links==
  
public class Person : System.Web.UI.Page
+
[http://www.archive.org/details/arsdigitac04 Object-Oriented Program Design and Software Engineering]
 +
http://www.codeproject.com/cpp/oopuml.asp OOP and UML
  
{
+
[[Category:Programming Language Concepts]]
    private string name;
+
[[Category:Object Oriented Programming]]
    private int age;
+
[[Category:C Sharp]]
    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 ===
 
<perl>
 
#!/usr/local/bin/perl5.8.2
 
#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