SlideShare a Scribd company logo
20070329 Object Oriented Programing Tips
   M



public class Shape{
  protected int h,w;
  public void setWidth(int w){
           this.w = w;
  }
  public void setHeight(int h){
           this.h = h;                   →
  }
}
public class Rectangele extends Shape{
}

public class Square extends Rectangle{
  protected int h,w;
  public void setWidth(int w){
           this.w = w;                   →
           this.h = h;
  }
  public void setHeight(int h){
           this.w = w;
           this.h = h;
  }
}
LSP
public class Shape{
  protected int h,w;
                                         ArrayList<Rectangele> list
  public void setWidth(int w){                  = new ArrayList<Rectangele>();
           this.w = w;
  }
  public void setHeight(int h){          for(Rectangler r : list){
  }
           this.h = h;                          r.setWidth(20);
}                                               r.setHeight(10);
                                         }
public class Rectangele extends Shape{
}

public class Square extends Rectangle{
  protected int h,w;
  public void setWidth(int w){
           this.w = w;
           this.h = h;
  }                                      List        Square
  public void setHeight(int h){
           this.w = w;
           this.h = h;
  }
}
public class User{
   public void dosth(Shape s){                     public Interface Shape{
      s.dosth();                                      public void dosth();
   }                                               }
}


       public class Rectangle implements Shape{    public class Square implements Shape{
          public void dosth(){                        public void dosth(){
             System.out.println(“do something”);         System.out.println(“do something”);
          }                                           }
       }                                           }




                                  Light Weight
                   POJP          Plain Old Java Object


   Gof
   23        new



         →
   Temprate Method
   Strategy

   Factory Method

   Command
   State
   Null Object
Template Method
public abstract class DBInterface{                     public class OracleInterface extends DBInterface{
  public Date getData(){                                 protected void init(){
     init();                                                  //
     Data data = getData();
     exit();
     return data;                                          }
  }                                                        protected Data getData(){
   protected abstract void init();                             //
   protected abstract Data getData();                      }
   protected abstract void exit();                         protected void exit(){
}                                                              //


                                                         }
                                        extends        }ublic class FireBirdInterface extends DBInterface{
                                                       p
                                                          ////
                                                       }
                                   Data



                                                 DBInterface
             =
      =public
Strategy
    public Interface DBInterface{               public class OracleInterface implements DBInterface{
      public void init();                         public void init(){
      public Data getData();                           //
      public void exit();                           }
    }                                               public Data getData(){
                                                       //
                                                    }
                           implements               public void exit(){
                                                       //
                                                    }
                                                }


                                                public class FireBirdInterface implements DBInterface{
                                                   ////
                                                }

    Template



                                       DBInterface
Template Method                          Strategy
    public class TemlePrinter {                                     Template Method
      main(){
        DBInterface di = new OracleInterface();
        print(di.getData());                              uses
      }                                                                        getData()
    }


    public class StratPrinter {
      main(){                                                       Strategy
        DBInterface di = new OracleInterface();
        di.init()
        print(di.getData());                              uses       init()        getData()
        di.exit();
      }                                                              exit()
    }

    Template Method                                                               Strategy

                       =                         Template Method
                              Strategy
                        Strategy                                                              init
                                         DB                               Template Method
Factory Method
                                                                         public Interface Bond{
                public Interface BondFactory{           creates            public int getMaturity();
                  public Bond getBondInstance();
                                                                           public BigDecimal getFairValue();
                }
                                                                         }

                                  implements                                                implements

    public class TreasuryFactory implements BondFactory{             public class Treasury implements Bond{
       public Bond getBondInstance(){                                   ////
          return new Treasury();                                     }
       }
    }


    public class ConvertibleFactory implements BondFactory{         public class Convertible implements Bond{
       public Bond getBondInstance(){                                  ////
          return new Convertible();
                                                                    }
       }
    }






                     Bond                                    Strategy   Template
                      Factory                                                                     Factory
Command



 public class User{
    public void dosth(Tranzaction t,String id){
       t.do(id);                                             public Interface Tranzaction{
    }                                                           public void do(String id);
 }                                                           }



  public class addCommand implements Tranzaction{
     public void do(String id){
        //
      }
  }

                                                  public class removeCommand implements Tranzaction{
                                                     public void do(String id){
                                                        //
                                                      }
                                                  }
State



  public class User{
     State s = n;
     public void dosth(){                                 public Interface State{
        s.do();                                              public int do();
     }                                                    }
  }


   public class GoodState implements State{
      public void do(){
         System.ouit.println(“Good State”);
      }
   }

                                              public class BadState implements State{
                                                 public void do(){
                                                    System.ouit.println(“Good State”);
                                                 }
                                              }
Null Object

                 Null

 public class User{
    public void dosth(Tranzaction t,String id){   public Interface Tranzaction{
       t.do(id);                                     public void do(String id);
    }                                             }
 }




                              public class NullCommand implements Tranzaction{
                                 public void do(String id){
                                       //
                                   }
                              }
DI Dipendency Injection


 public class User{
    public void dosth(Tranzaction t,String id){
       t.do(id);                                             public Interface Tranzaction{
    }                                                           public void do(String id);
 }                                                           }




                DI

         Tranzaction

                                                  public class removeCommand implements Tranzaction{
                                                     public void do(String id){
                                                        //
                                                      }
                                                  }
DI
                new

     –


     –




   DI
     – Spring
     – Seaser2
     – EJB 3.0
Strategy/Temprate Method



DI
20070329 Object Oriented Programing Tips

More Related Content

What's hot (20)

Design pattern part 2 - structural pattern
Design pattern part 2 - structural patternDesign pattern part 2 - structural pattern
Design pattern part 2 - structural pattern
Jieyi Wu
 
Design pattern - part 3
Design pattern - part 3Design pattern - part 3
Design pattern - part 3
Jieyi Wu
 
11slide
11slide11slide
11slide
Dorothea Chaffin
 
Wed 1630 greene_robert_color
Wed 1630 greene_robert_colorWed 1630 greene_robert_color
Wed 1630 greene_robert_color
DATAVERSITY
 
Awt
AwtAwt
Awt
Swarup Saha
 
Lecture21
Lecture21Lecture21
Lecture21
elearning_portal
 
Architecting for PHP5 - Why "Runs on PHP5" is not "Written for PHP5"
Architecting for PHP5 - Why "Runs on PHP5" is not "Written for PHP5"Architecting for PHP5 - Why "Runs on PHP5" is not "Written for PHP5"
Architecting for PHP5 - Why "Runs on PHP5" is not "Written for PHP5"
ZendCon
 
Spring Data JPA
Spring Data JPASpring Data JPA
Spring Data JPA
Cheng Ta Yeh
 
Java Code for Sample Projects Inheritance
Java Code for Sample Projects InheritanceJava Code for Sample Projects Inheritance
Java Code for Sample Projects Inheritance
jwjablonski
 
10slide
10slide10slide
10slide
Dorothea Chaffin
 
08slide
08slide08slide
08slide
Dorothea Chaffin
 
11slide
11slide11slide
11slide
IIUM
 
Concurrencyproblem
ConcurrencyproblemConcurrencyproblem
Concurrencyproblem
Adriano Patrick Cunha
 
JNI - Java & C in the same project
JNI - Java & C in the same projectJNI - Java & C in the same project
JNI - Java & C in the same project
Karol Wrótniak
 
Java Persistence API
Java Persistence APIJava Persistence API
Java Persistence API
Carol McDonald
 
Lo Mejor Del Pdc2008 El Futrode C#
Lo Mejor Del Pdc2008 El Futrode C#Lo Mejor Del Pdc2008 El Futrode C#
Lo Mejor Del Pdc2008 El Futrode C#
Juan Pablo
 
Treinamento Qt básico - aula II
Treinamento Qt básico - aula IITreinamento Qt básico - aula II
Treinamento Qt básico - aula II
Marcelo Barros de Almeida
 
Java Day-1
Java Day-1Java Day-1
Java Day-1
People Strategists
 
Spring data presentation
Spring data presentationSpring data presentation
Spring data presentation
Oleksii Usyk
 
Java_practical_handbook
Java_practical_handbookJava_practical_handbook
Java_practical_handbook
Manusha Dilan
 
Design pattern part 2 - structural pattern
Design pattern part 2 - structural patternDesign pattern part 2 - structural pattern
Design pattern part 2 - structural pattern
Jieyi Wu
 
Design pattern - part 3
Design pattern - part 3Design pattern - part 3
Design pattern - part 3
Jieyi Wu
 
Wed 1630 greene_robert_color
Wed 1630 greene_robert_colorWed 1630 greene_robert_color
Wed 1630 greene_robert_color
DATAVERSITY
 
Architecting for PHP5 - Why "Runs on PHP5" is not "Written for PHP5"
Architecting for PHP5 - Why "Runs on PHP5" is not "Written for PHP5"Architecting for PHP5 - Why "Runs on PHP5" is not "Written for PHP5"
Architecting for PHP5 - Why "Runs on PHP5" is not "Written for PHP5"
ZendCon
 
Java Code for Sample Projects Inheritance
Java Code for Sample Projects InheritanceJava Code for Sample Projects Inheritance
Java Code for Sample Projects Inheritance
jwjablonski
 
11slide
11slide11slide
11slide
IIUM
 
JNI - Java & C in the same project
JNI - Java & C in the same projectJNI - Java & C in the same project
JNI - Java & C in the same project
Karol Wrótniak
 
Lo Mejor Del Pdc2008 El Futrode C#
Lo Mejor Del Pdc2008 El Futrode C#Lo Mejor Del Pdc2008 El Futrode C#
Lo Mejor Del Pdc2008 El Futrode C#
Juan Pablo
 
Spring data presentation
Spring data presentationSpring data presentation
Spring data presentation
Oleksii Usyk
 
Java_practical_handbook
Java_practical_handbookJava_practical_handbook
Java_practical_handbook
Manusha Dilan
 

Viewers also liked (13)

Principles of object oriented programing
Principles of object oriented programingPrinciples of object oriented programing
Principles of object oriented programing
Ahammed Alamin
 
Oops concept
Oops conceptOops concept
Oops concept
baabtra.com - No. 1 supplier of quality freshers
 
Basic concepts of oops
Basic concepts of oopsBasic concepts of oops
Basic concepts of oops
Chandrakiran Satdeve
 
concept of oops
concept of oopsconcept of oops
concept of oops
prince sharma
 
OOPS IN C++
OOPS IN C++OOPS IN C++
OOPS IN C++
Amritsinghmehra
 
Flip flops (ff)
Flip flops (ff)Flip flops (ff)
Flip flops (ff)
Arturo Guillén
 
Object-Oriented Programming Using C++
Object-Oriented Programming Using C++Object-Oriented Programming Using C++
Object-Oriented Programming Using C++
Salahaddin University-Erbil
 
Flip flop
Flip flopFlip flop
Flip flop
hattieu16590
 
Flip flop’s state tables & diagrams
Flip flop’s state tables & diagramsFlip flop’s state tables & diagrams
Flip flop’s state tables & diagrams
Sunny Khatana
 
What are Flip Flops and Its types.
What are Flip Flops and Its types.What are Flip Flops and Its types.
What are Flip Flops and Its types.
Satya P. Joshi
 
Flipflop
FlipflopFlipflop
Flipflop
sohamdodia27
 
Oops ppt
Oops pptOops ppt
Oops ppt
abhayjuneja
 
Chapter 4 flip flop for students
Chapter 4 flip flop for studentsChapter 4 flip flop for students
Chapter 4 flip flop for students
CT Sabariah Salihin
 
Ad

Similar to 20070329 Object Oriented Programing Tips (20)

OOP: Class Hierarchies
OOP: Class HierarchiesOOP: Class Hierarchies
OOP: Class Hierarchies
Atit Patumvan
 
Java beans
Java beansJava beans
Java beans
Mukesh Tekwani
 
Implementation of interface9 cm604.30
Implementation of interface9 cm604.30Implementation of interface9 cm604.30
Implementation of interface9 cm604.30
myrajendra
 
Design Patterns Reconsidered
Design Patterns ReconsideredDesign Patterns Reconsidered
Design Patterns Reconsidered
Alex Miller
 
Embedded Typesafe Domain Specific Languages for Java
Embedded Typesafe Domain Specific Languages for JavaEmbedded Typesafe Domain Specific Languages for Java
Embedded Typesafe Domain Specific Languages for Java
Jevgeni Kabanov
 
Have Your Cake and Eat It Too: Meta-Programming Techniques for Java
Have Your Cake and Eat It Too: Meta-Programming Techniques for JavaHave Your Cake and Eat It Too: Meta-Programming Techniques for Java
Have Your Cake and Eat It Too: Meta-Programming Techniques for Java
Howard Lewis Ship
 
Spring data
Spring dataSpring data
Spring data
명철 강
 
Object Oriented Solved Practice Programs C++ Exams
Object Oriented Solved Practice Programs C++ ExamsObject Oriented Solved Practice Programs C++ Exams
Object Oriented Solved Practice Programs C++ Exams
MuhammadTalha436
 
Design patterns
Design patternsDesign patterns
Design patterns
Rajat Arora
 
C h 04 oop_inheritance
C h 04 oop_inheritanceC h 04 oop_inheritance
C h 04 oop_inheritance
shatha00
 
Model-Driven Software Development - Context-Sensitive Transformation
Model-Driven Software Development - Context-Sensitive TransformationModel-Driven Software Development - Context-Sensitive Transformation
Model-Driven Software Development - Context-Sensitive Transformation
Eelco Visser
 
Strategy Design Pattern
Strategy Design PatternStrategy Design Pattern
Strategy Design Pattern
Ganesh Kolhe
 
oop presentation note
oop presentation note oop presentation note
oop presentation note
Atit Patumvan
 
Better Software: introduction to good code
Better Software: introduction to good codeBetter Software: introduction to good code
Better Software: introduction to good code
Giordano Scalzo
 
java experiments and programs
java experiments and programsjava experiments and programs
java experiments and programs
Karuppaiyaa123
 
CodeCamp Iasi 10 march 2012 - Practical Groovy
CodeCamp Iasi 10 march 2012 - Practical GroovyCodeCamp Iasi 10 march 2012 - Practical Groovy
CodeCamp Iasi 10 march 2012 - Practical Groovy
Codecamp Romania
 
Domänenspezifische Sprachen mit Xtext
Domänenspezifische Sprachen mit XtextDomänenspezifische Sprachen mit Xtext
Domänenspezifische Sprachen mit Xtext
Dr. Jan Köhnlein
 
Building DSLs With Eclipse
Building DSLs With EclipseBuilding DSLs With Eclipse
Building DSLs With Eclipse
Peter Friese
 
Java beginners meetup: Introduction to class and application design
Java beginners meetup: Introduction to class and application designJava beginners meetup: Introduction to class and application design
Java beginners meetup: Introduction to class and application design
Patrick Kostjens
 
Developing Useful APIs
Developing Useful APIsDeveloping Useful APIs
Developing Useful APIs
Dmitry Buzdin
 
OOP: Class Hierarchies
OOP: Class HierarchiesOOP: Class Hierarchies
OOP: Class Hierarchies
Atit Patumvan
 
Implementation of interface9 cm604.30
Implementation of interface9 cm604.30Implementation of interface9 cm604.30
Implementation of interface9 cm604.30
myrajendra
 
Design Patterns Reconsidered
Design Patterns ReconsideredDesign Patterns Reconsidered
Design Patterns Reconsidered
Alex Miller
 
Embedded Typesafe Domain Specific Languages for Java
Embedded Typesafe Domain Specific Languages for JavaEmbedded Typesafe Domain Specific Languages for Java
Embedded Typesafe Domain Specific Languages for Java
Jevgeni Kabanov
 
Have Your Cake and Eat It Too: Meta-Programming Techniques for Java
Have Your Cake and Eat It Too: Meta-Programming Techniques for JavaHave Your Cake and Eat It Too: Meta-Programming Techniques for Java
Have Your Cake and Eat It Too: Meta-Programming Techniques for Java
Howard Lewis Ship
 
Object Oriented Solved Practice Programs C++ Exams
Object Oriented Solved Practice Programs C++ ExamsObject Oriented Solved Practice Programs C++ Exams
Object Oriented Solved Practice Programs C++ Exams
MuhammadTalha436
 
C h 04 oop_inheritance
C h 04 oop_inheritanceC h 04 oop_inheritance
C h 04 oop_inheritance
shatha00
 
Model-Driven Software Development - Context-Sensitive Transformation
Model-Driven Software Development - Context-Sensitive TransformationModel-Driven Software Development - Context-Sensitive Transformation
Model-Driven Software Development - Context-Sensitive Transformation
Eelco Visser
 
Strategy Design Pattern
Strategy Design PatternStrategy Design Pattern
Strategy Design Pattern
Ganesh Kolhe
 
oop presentation note
oop presentation note oop presentation note
oop presentation note
Atit Patumvan
 
Better Software: introduction to good code
Better Software: introduction to good codeBetter Software: introduction to good code
Better Software: introduction to good code
Giordano Scalzo
 
java experiments and programs
java experiments and programsjava experiments and programs
java experiments and programs
Karuppaiyaa123
 
CodeCamp Iasi 10 march 2012 - Practical Groovy
CodeCamp Iasi 10 march 2012 - Practical GroovyCodeCamp Iasi 10 march 2012 - Practical Groovy
CodeCamp Iasi 10 march 2012 - Practical Groovy
Codecamp Romania
 
Domänenspezifische Sprachen mit Xtext
Domänenspezifische Sprachen mit XtextDomänenspezifische Sprachen mit Xtext
Domänenspezifische Sprachen mit Xtext
Dr. Jan Köhnlein
 
Building DSLs With Eclipse
Building DSLs With EclipseBuilding DSLs With Eclipse
Building DSLs With Eclipse
Peter Friese
 
Java beginners meetup: Introduction to class and application design
Java beginners meetup: Introduction to class and application designJava beginners meetup: Introduction to class and application design
Java beginners meetup: Introduction to class and application design
Patrick Kostjens
 
Developing Useful APIs
Developing Useful APIsDeveloping Useful APIs
Developing Useful APIs
Dmitry Buzdin
 
Ad

More from Shingo Furuyama (12)

ストリームデータに量子アニーリングを適用するアプリケーションフレームワークとその有用性
ストリームデータに量子アニーリングを適用するアプリケーションフレームワークとその有用性ストリームデータに量子アニーリングを適用するアプリケーションフレームワークとその有用性
ストリームデータに量子アニーリングを適用するアプリケーションフレームワークとその有用性
Shingo Furuyama
 
Hadoop Source Code Reading #17
Hadoop Source Code Reading #17Hadoop Source Code Reading #17
Hadoop Source Code Reading #17
Shingo Furuyama
 
Hadoop distributions as of 20131231
Hadoop distributions as of 20131231Hadoop distributions as of 20131231
Hadoop distributions as of 20131231
Shingo Furuyama
 
Askusa on AWS
Askusa on AWSAskusa on AWS
Askusa on AWS
Shingo Furuyama
 
Askusa on aws
Askusa on awsAskusa on aws
Askusa on aws
Shingo Furuyama
 
Askusa on aws
Askusa on awsAskusa on aws
Askusa on aws
Shingo Furuyama
 
Clojureのstm実装について
Clojureのstm実装についてClojureのstm実装について
Clojureのstm実装について
Shingo Furuyama
 
Asakusa Framework Tutorial β版
Asakusa Framework Tutorial β版Asakusa Framework Tutorial β版
Asakusa Framework Tutorial β版
Shingo Furuyama
 
20070329 Tech Study
20070329 Tech Study 20070329 Tech Study
20070329 Tech Study
Shingo Furuyama
 
20070329 Java Programing Tips
20070329 Java Programing Tips20070329 Java Programing Tips
20070329 Java Programing Tips
Shingo Furuyama
 
#ajn3.lt.marblejenka
#ajn3.lt.marblejenka#ajn3.lt.marblejenka
#ajn3.lt.marblejenka
Shingo Furuyama
 
ストリームデータに量子アニーリングを適用するアプリケーションフレームワークとその有用性
ストリームデータに量子アニーリングを適用するアプリケーションフレームワークとその有用性ストリームデータに量子アニーリングを適用するアプリケーションフレームワークとその有用性
ストリームデータに量子アニーリングを適用するアプリケーションフレームワークとその有用性
Shingo Furuyama
 
Hadoop Source Code Reading #17
Hadoop Source Code Reading #17Hadoop Source Code Reading #17
Hadoop Source Code Reading #17
Shingo Furuyama
 
Hadoop distributions as of 20131231
Hadoop distributions as of 20131231Hadoop distributions as of 20131231
Hadoop distributions as of 20131231
Shingo Furuyama
 
Clojureのstm実装について
Clojureのstm実装についてClojureのstm実装について
Clojureのstm実装について
Shingo Furuyama
 
Asakusa Framework Tutorial β版
Asakusa Framework Tutorial β版Asakusa Framework Tutorial β版
Asakusa Framework Tutorial β版
Shingo Furuyama
 
20070329 Java Programing Tips
20070329 Java Programing Tips20070329 Java Programing Tips
20070329 Java Programing Tips
Shingo Furuyama
 

Recently uploaded (20)

Introducing the OSA 3200 SP and OSA 3250 ePRC
Introducing the OSA 3200 SP and OSA 3250 ePRCIntroducing the OSA 3200 SP and OSA 3250 ePRC
Introducing the OSA 3200 SP and OSA 3250 ePRC
Adtran
 
Offshore IT Support: Balancing In-House and Offshore Help Desk Technicians
Offshore IT Support: Balancing In-House and Offshore Help Desk TechniciansOffshore IT Support: Balancing In-House and Offshore Help Desk Technicians
Offshore IT Support: Balancing In-House and Offshore Help Desk Technicians
john823664
 
Kubernetes Cloud Native Indonesia Meetup - May 2025
Kubernetes Cloud Native Indonesia Meetup - May 2025Kubernetes Cloud Native Indonesia Meetup - May 2025
Kubernetes Cloud Native Indonesia Meetup - May 2025
Prasta Maha
 
European Accessibility Act & Integrated Accessibility Testing
European Accessibility Act & Integrated Accessibility TestingEuropean Accessibility Act & Integrated Accessibility Testing
European Accessibility Act & Integrated Accessibility Testing
Julia Undeutsch
 
End-to-end Assurance for SD-WAN & SASE with ThousandEyes
End-to-end Assurance for SD-WAN & SASE with ThousandEyesEnd-to-end Assurance for SD-WAN & SASE with ThousandEyes
End-to-end Assurance for SD-WAN & SASE with ThousandEyes
ThousandEyes
 
Let’s Get Slack Certified! 🚀- Slack Community
Let’s Get Slack Certified! 🚀- Slack CommunityLet’s Get Slack Certified! 🚀- Slack Community
Let’s Get Slack Certified! 🚀- Slack Community
SanjeetMishra29
 
ECS25 - The adventures of a Microsoft 365 Platform Owner - Website.pptx
ECS25 - The adventures of a Microsoft 365 Platform Owner - Website.pptxECS25 - The adventures of a Microsoft 365 Platform Owner - Website.pptx
ECS25 - The adventures of a Microsoft 365 Platform Owner - Website.pptx
Jasper Oosterveld
 
Measuring Microsoft 365 Copilot and Gen AI Success
Measuring Microsoft 365 Copilot and Gen AI SuccessMeasuring Microsoft 365 Copilot and Gen AI Success
Measuring Microsoft 365 Copilot and Gen AI Success
Nikki Chapple
 
UiPath Community Zurich: Release Management and Build Pipelines
UiPath Community Zurich: Release Management and Build PipelinesUiPath Community Zurich: Release Management and Build Pipelines
UiPath Community Zurich: Release Management and Build Pipelines
UiPathCommunity
 
Cybersecurity Fundamentals: Apprentice - Palo Alto Certificate
Cybersecurity Fundamentals: Apprentice - Palo Alto CertificateCybersecurity Fundamentals: Apprentice - Palo Alto Certificate
Cybersecurity Fundamentals: Apprentice - Palo Alto Certificate
VICTOR MAESTRE RAMIREZ
 
GDG Cloud Southlake #43: Tommy Todd: The Quantum Apocalypse: A Looming Threat...
GDG Cloud Southlake #43: Tommy Todd: The Quantum Apocalypse: A Looming Threat...GDG Cloud Southlake #43: Tommy Todd: The Quantum Apocalypse: A Looming Threat...
GDG Cloud Southlake #43: Tommy Todd: The Quantum Apocalypse: A Looming Threat...
James Anderson
 
Evaluation Challenges in Using Generative AI for Science & Technical Content
Evaluation Challenges in Using Generative AI for Science & Technical ContentEvaluation Challenges in Using Generative AI for Science & Technical Content
Evaluation Challenges in Using Generative AI for Science & Technical Content
Paul Groth
 
Maxx nft market place new generation nft marketing place
Maxx nft market place new generation nft marketing placeMaxx nft market place new generation nft marketing place
Maxx nft market place new generation nft marketing place
usersalmanrazdelhi
 
STKI Israel Market Study 2025 final v1 version
STKI Israel Market Study 2025 final v1 versionSTKI Israel Market Study 2025 final v1 version
STKI Israel Market Study 2025 final v1 version
Dr. Jimmy Schwarzkopf
 
Gihbli AI and Geo sitution |use/misuse of Ai Technology
Gihbli AI and Geo sitution |use/misuse of Ai TechnologyGihbli AI and Geo sitution |use/misuse of Ai Technology
Gihbli AI and Geo sitution |use/misuse of Ai Technology
zainkhurram1111
 
Agentic AI - The New Era of Intelligence
Agentic AI - The New Era of IntelligenceAgentic AI - The New Era of Intelligence
Agentic AI - The New Era of Intelligence
Muzammil Shah
 
Nix(OS) for Python Developers - PyCon 25 (Bologna, Italia)
Nix(OS) for Python Developers - PyCon 25 (Bologna, Italia)Nix(OS) for Python Developers - PyCon 25 (Bologna, Italia)
Nix(OS) for Python Developers - PyCon 25 (Bologna, Italia)
Peter Bittner
 
Create Your First AI Agent with UiPath Agent Builder
Create Your First AI Agent with UiPath Agent BuilderCreate Your First AI Agent with UiPath Agent Builder
Create Your First AI Agent with UiPath Agent Builder
DianaGray10
 
Agentic AI Explained: The Next Frontier of Autonomous Intelligence & Generati...
Agentic AI Explained: The Next Frontier of Autonomous Intelligence & Generati...Agentic AI Explained: The Next Frontier of Autonomous Intelligence & Generati...
Agentic AI Explained: The Next Frontier of Autonomous Intelligence & Generati...
Aaryan Kansari
 
Co-Constructing Explanations for AI Systems using Provenance
Co-Constructing Explanations for AI Systems using ProvenanceCo-Constructing Explanations for AI Systems using Provenance
Co-Constructing Explanations for AI Systems using Provenance
Paul Groth
 
Introducing the OSA 3200 SP and OSA 3250 ePRC
Introducing the OSA 3200 SP and OSA 3250 ePRCIntroducing the OSA 3200 SP and OSA 3250 ePRC
Introducing the OSA 3200 SP and OSA 3250 ePRC
Adtran
 
Offshore IT Support: Balancing In-House and Offshore Help Desk Technicians
Offshore IT Support: Balancing In-House and Offshore Help Desk TechniciansOffshore IT Support: Balancing In-House and Offshore Help Desk Technicians
Offshore IT Support: Balancing In-House and Offshore Help Desk Technicians
john823664
 
Kubernetes Cloud Native Indonesia Meetup - May 2025
Kubernetes Cloud Native Indonesia Meetup - May 2025Kubernetes Cloud Native Indonesia Meetup - May 2025
Kubernetes Cloud Native Indonesia Meetup - May 2025
Prasta Maha
 
European Accessibility Act & Integrated Accessibility Testing
European Accessibility Act & Integrated Accessibility TestingEuropean Accessibility Act & Integrated Accessibility Testing
European Accessibility Act & Integrated Accessibility Testing
Julia Undeutsch
 
End-to-end Assurance for SD-WAN & SASE with ThousandEyes
End-to-end Assurance for SD-WAN & SASE with ThousandEyesEnd-to-end Assurance for SD-WAN & SASE with ThousandEyes
End-to-end Assurance for SD-WAN & SASE with ThousandEyes
ThousandEyes
 
Let’s Get Slack Certified! 🚀- Slack Community
Let’s Get Slack Certified! 🚀- Slack CommunityLet’s Get Slack Certified! 🚀- Slack Community
Let’s Get Slack Certified! 🚀- Slack Community
SanjeetMishra29
 
ECS25 - The adventures of a Microsoft 365 Platform Owner - Website.pptx
ECS25 - The adventures of a Microsoft 365 Platform Owner - Website.pptxECS25 - The adventures of a Microsoft 365 Platform Owner - Website.pptx
ECS25 - The adventures of a Microsoft 365 Platform Owner - Website.pptx
Jasper Oosterveld
 
Measuring Microsoft 365 Copilot and Gen AI Success
Measuring Microsoft 365 Copilot and Gen AI SuccessMeasuring Microsoft 365 Copilot and Gen AI Success
Measuring Microsoft 365 Copilot and Gen AI Success
Nikki Chapple
 
UiPath Community Zurich: Release Management and Build Pipelines
UiPath Community Zurich: Release Management and Build PipelinesUiPath Community Zurich: Release Management and Build Pipelines
UiPath Community Zurich: Release Management and Build Pipelines
UiPathCommunity
 
Cybersecurity Fundamentals: Apprentice - Palo Alto Certificate
Cybersecurity Fundamentals: Apprentice - Palo Alto CertificateCybersecurity Fundamentals: Apprentice - Palo Alto Certificate
Cybersecurity Fundamentals: Apprentice - Palo Alto Certificate
VICTOR MAESTRE RAMIREZ
 
GDG Cloud Southlake #43: Tommy Todd: The Quantum Apocalypse: A Looming Threat...
GDG Cloud Southlake #43: Tommy Todd: The Quantum Apocalypse: A Looming Threat...GDG Cloud Southlake #43: Tommy Todd: The Quantum Apocalypse: A Looming Threat...
GDG Cloud Southlake #43: Tommy Todd: The Quantum Apocalypse: A Looming Threat...
James Anderson
 
Evaluation Challenges in Using Generative AI for Science & Technical Content
Evaluation Challenges in Using Generative AI for Science & Technical ContentEvaluation Challenges in Using Generative AI for Science & Technical Content
Evaluation Challenges in Using Generative AI for Science & Technical Content
Paul Groth
 
Maxx nft market place new generation nft marketing place
Maxx nft market place new generation nft marketing placeMaxx nft market place new generation nft marketing place
Maxx nft market place new generation nft marketing place
usersalmanrazdelhi
 
STKI Israel Market Study 2025 final v1 version
STKI Israel Market Study 2025 final v1 versionSTKI Israel Market Study 2025 final v1 version
STKI Israel Market Study 2025 final v1 version
Dr. Jimmy Schwarzkopf
 
Gihbli AI and Geo sitution |use/misuse of Ai Technology
Gihbli AI and Geo sitution |use/misuse of Ai TechnologyGihbli AI and Geo sitution |use/misuse of Ai Technology
Gihbli AI and Geo sitution |use/misuse of Ai Technology
zainkhurram1111
 
Agentic AI - The New Era of Intelligence
Agentic AI - The New Era of IntelligenceAgentic AI - The New Era of Intelligence
Agentic AI - The New Era of Intelligence
Muzammil Shah
 
Nix(OS) for Python Developers - PyCon 25 (Bologna, Italia)
Nix(OS) for Python Developers - PyCon 25 (Bologna, Italia)Nix(OS) for Python Developers - PyCon 25 (Bologna, Italia)
Nix(OS) for Python Developers - PyCon 25 (Bologna, Italia)
Peter Bittner
 
Create Your First AI Agent with UiPath Agent Builder
Create Your First AI Agent with UiPath Agent BuilderCreate Your First AI Agent with UiPath Agent Builder
Create Your First AI Agent with UiPath Agent Builder
DianaGray10
 
Agentic AI Explained: The Next Frontier of Autonomous Intelligence & Generati...
Agentic AI Explained: The Next Frontier of Autonomous Intelligence & Generati...Agentic AI Explained: The Next Frontier of Autonomous Intelligence & Generati...
Agentic AI Explained: The Next Frontier of Autonomous Intelligence & Generati...
Aaryan Kansari
 
Co-Constructing Explanations for AI Systems using Provenance
Co-Constructing Explanations for AI Systems using ProvenanceCo-Constructing Explanations for AI Systems using Provenance
Co-Constructing Explanations for AI Systems using Provenance
Paul Groth
 

20070329 Object Oriented Programing Tips

  • 2. M 
  • 3. public class Shape{ protected int h,w; public void setWidth(int w){ this.w = w; } public void setHeight(int h){ this.h = h; → } } public class Rectangele extends Shape{ } public class Square extends Rectangle{ protected int h,w; public void setWidth(int w){ this.w = w; → this.h = h; } public void setHeight(int h){ this.w = w; this.h = h; } }
  • 4. LSP public class Shape{ protected int h,w; ArrayList<Rectangele> list public void setWidth(int w){ = new ArrayList<Rectangele>(); this.w = w; } public void setHeight(int h){ for(Rectangler r : list){ } this.h = h; r.setWidth(20); } r.setHeight(10); } public class Rectangele extends Shape{ } public class Square extends Rectangle{ protected int h,w; public void setWidth(int w){ this.w = w; this.h = h; } List Square public void setHeight(int h){ this.w = w; this.h = h; } }
  • 5. public class User{ public void dosth(Shape s){ public Interface Shape{ s.dosth(); public void dosth(); } } } public class Rectangle implements Shape{ public class Square implements Shape{ public void dosth(){ public void dosth(){ System.out.println(“do something”); System.out.println(“do something”); } } } } Light Weight POJP Plain Old Java Object
  • 6.   Gof  23 new  →
  • 7. Temprate Method  Strategy  Factory Method  Command  State  Null Object
  • 8. Template Method public abstract class DBInterface{ public class OracleInterface extends DBInterface{ public Date getData(){ protected void init(){ init(); // Data data = getData(); exit(); return data; } } protected Data getData(){ protected abstract void init(); // protected abstract Data getData(); } protected abstract void exit(); protected void exit(){ } // } extends }ublic class FireBirdInterface extends DBInterface{ p //// }  Data   DBInterface = =public
  • 9. Strategy public Interface DBInterface{ public class OracleInterface implements DBInterface{ public void init(); public void init(){ public Data getData(); // public void exit(); } } public Data getData(){ // } implements public void exit(){ // } } public class FireBirdInterface implements DBInterface{ //// }  Template   DBInterface
  • 10. Template Method Strategy public class TemlePrinter { Template Method main(){ DBInterface di = new OracleInterface(); print(di.getData()); uses } getData() } public class StratPrinter { main(){ Strategy DBInterface di = new OracleInterface(); di.init() print(di.getData()); uses init() getData() di.exit(); } exit() }  Template Method Strategy  = Template Method Strategy Strategy init DB Template Method
  • 11. Factory Method public Interface Bond{ public Interface BondFactory{ creates public int getMaturity(); public Bond getBondInstance(); public BigDecimal getFairValue(); } } implements implements public class TreasuryFactory implements BondFactory{ public class Treasury implements Bond{ public Bond getBondInstance(){ //// return new Treasury(); } } } public class ConvertibleFactory implements BondFactory{ public class Convertible implements Bond{ public Bond getBondInstance(){ //// return new Convertible(); } } }    Bond Strategy Template Factory Factory
  • 12. Command public class User{ public void dosth(Tranzaction t,String id){ t.do(id); public Interface Tranzaction{ } public void do(String id); } } public class addCommand implements Tranzaction{ public void do(String id){ // } } public class removeCommand implements Tranzaction{ public void do(String id){ // } }
  • 13. State public class User{ State s = n; public void dosth(){ public Interface State{ s.do(); public int do(); } } } public class GoodState implements State{ public void do(){ System.ouit.println(“Good State”); } } public class BadState implements State{ public void do(){ System.ouit.println(“Good State”); } }
  • 14. Null Object Null public class User{ public void dosth(Tranzaction t,String id){ public Interface Tranzaction{ t.do(id); public void do(String id); } } } public class NullCommand implements Tranzaction{ public void do(String id){ // } }
  • 15. DI Dipendency Injection public class User{ public void dosth(Tranzaction t,String id){ t.do(id); public Interface Tranzaction{ } public void do(String id); } } DI Tranzaction public class removeCommand implements Tranzaction{ public void do(String id){ // } }
  • 16. DI  new – –  DI – Spring – Seaser2 – EJB 3.0