2003 12 16 ( )
ML
Java,.NET, UML J2EE, Web Java, J2EE.NET SI
ex. )
OO OO OO OO OO
(Controller) (Promoter) (Analyzer) (Supporter) http://nba.nikkeibp.co.jp/coachsp.html
It takes time.
OO OK
OO
1. 2. 3.
1. 2.
PC
Jackson NEC
Ex. Michael Michael ckson Hoo!
A B B A A B B A A B A B B
Java Java public interface Product { public int getprice(); public class NormalProduct implements Product { : public int getprice() { return price; private int price;
(OO,DOA,
1. 2. 3.
Jackson NEC NEC
x 0.05 x 0.05 x 0.07 ProjectUtil.calcTax( ) ProjectUtil.calcTax(, ) Product public BigDecimal gettax(){ return Money.getTax(, ); private ; private ; ProjectUtil Product Money tax = product.gettax();
B A C
A B
http://www.geocities.jp/objectbrain/ Java
private Ningen.java public class Ningen{ private String name; private int shincho; public Ningen(String name, int shincho) { this.name = name; this.shincho = shincho; public void taberu(){ System.out.println(" "); taberu neru public void neru(){ System.out.println(" ");
Manager.java public class Manager{ public static void main(string[] args){ Ningen ningen = new Ningen( ", 169); C: > javac *.java Manager.class Ningen.class main Manger C: > java Manager ningen.taberu(); ningen.neru(); Ningen Ningen taberu neru Java 169
C: > javac Shacyo Tanto C: > javac Shacyo Shunin C: > javac Shacyo Bucho
Shain.java Shunin.java public interface Shain { public void standup(); public class Shunin implements Shain { public void standup(){ System.out.println(" "); class interface Interface Tanto.java Bcho.java public class Tanto implements Shain { public void standup(){ System.out.println(" System.out.println(" "); "); implements Shain Tanto public class Bucho implements Shain { public void standup(){
Shacho.java Shacho main String args public class Shacho { public static void main(string[] args) { Shain shain = null; if(args[0].equals("tanto")) { shain = new Tanto(); if(args[0].equals("shunin")) { shain = new Shunin(); if(args[0].equals("bucho")) { shain = new Bucho(); shain.standup(); args [0] Tanto { Tanto tanto = new Tanto();
300 C: > javac Shacyo Tanto 100 100 C: > javac Shacyo Shunin 100 100 201 C: > javac Shacyo Bucho 100
Shain.java Shunin.java public interface Shain { public void standup(); public int getkyuryo(int kihonkyu); Tanto.java public class Shunin implements Shain { public void standup(){ System.out.println(" "); public int getkyuro(int kihonkyu){ return kihonkyu * 2 + 1; public class Tanto implements Shain { public void standup(){ System.out.println(" "); public int getkyuryo(int kihonku){ return kihonkyu; Bucho.java public class Bucho implements Shain { public void standup(){ System.out.println(" "); public int getkyuryo(int kihonkyu){ return kihonkyu * 3;
Shacho.java public class Shacho { public static void main(string[] args) { Shain shain = null; if(args[0].equals("tanto")) { shain = new Tanto(); if(args[0].equals("shunin")) { shain = new Shunin(); if(args[0].equals("bucho")) { shain = new Bucho(); int kihonkyu = Integer.parseInt(args[1]); int kyuryo = shain.getkyuryo(kihonkyu); shain.standup(); System.out.println(" int Interface " + kyuryo + " ");
C: > javac Shacyo Torishimariyaku 100 402
C: > javac Shacyo Tanto 100 100 300 C: > javac Shacyo Shunin 100 100 201 300 C: > javac Shacyo Bucho 100 300 300
Shain.java abstract public class Shain { public void setkihonkyu(int kihonkyu) { this.kihonkyu = kihonkyu; public int getkihonkyu() { return kihonkyu; public int getbonus(){ return kihonkyu * 3; abstract public void standup(); abstract public int getkyuryo(); private int kihonkyu; interface abstract class abstract interface Abstract setkihonkyu()
Tanto.java Shunin.java public class Tanto extends Shain { public class Shunin extends Shain { public void standup(){ public void standup(){ System.out.println(" "); public int getkyuryo(){ int kihonkyu = getkihonkyu(); return kihonkyu; System.out.println(" "); public int getkyuryo(){ int kihonkyu = getkihonkyu(); return kihonkyu * 2 + 1; interface abstruct class implements extends abstract
Shacho.java public class Shacho { public static void main(string[] args) { Shain shain = null; if(args[0].equals("tanto")) { shain = new Tanto(); if(args[0].equals("shunin")) { shain = new Shunin(); if(args[0].equals("bucho")) { shain = new Bucho(); int kihonkyu = Integer.parseInt(args[1]); shain.setkihonkyu(kihonkyu); int kyuryo = shain.getkyuryo(); shain.standup(); System.out.println(" " + kyuryo + " "); System.out.println(" " + shain.getbonus() + " ");
ShainFactory.java Shacho.java public class ShainFactory { public class Shacho { public Shain factory(string type){ public static void main(string[] args) if(type.equals("tanto")) { { return new Tanto(); ShainFactory shainfactory = new ShainFactory(); Shain shain = if(type.equals("shunin")) { shainfactory.factory(args[0]); return new Shunin(); int kihonkyu = Integer.parseInt(args[1]); shain.setkihonkyu(kihonkyu); if(type.equals("bucho")) { int kyuryo = shain.getkyuryo(); return new Bucho(); shain.standup(); System.out.println(" " + kyuryo return new Tanto(); + " "); new System.out.println(" " + ShainFactory,if shain.getbonus() + " "); if new new
gorgeous 1.If you say that something is gorgeous, you mean that it gives you a lot of pleasure or is very attractive. 2.If you describe someone as gorgeous, you mean that you find them very sexually attractive. 3.If you describe things such as clothes and colors as gorgeous, you mean they are bright, rich, and impressive.
High Cohesion If If there there is is cohesion cohesion within within a a society, society, organization, organization, or or group, group, the the different different members members fit fit together together well well and and form form a a united united while. while.
Low Coupling 2 1 If If one one piece piece of of equipment equipment is is coupled coupled to to another, another, it it is is joined joined to to it it so so that that the the two two pieces pieces of of equipment equipment work work together. together. Coupling
Responsiblity -able Respons-ablity responsibility If you have responsibility for something or someone, or if they are your responsibility, it is your job or duty to deal with them and to take decisions relating to them. A responsiblitiy = an obligation to perform a task or know information #obligation #If you have an obligation to do something, it is your duty do that thing. #duty #If you say that something is your duty, you believe that you ought to do it because it is your responsiblitiy.
http://www.geocities.jp/objectbrain/ Collins COBUILD CD-ROM Object Design Rebecca Wirfs-Brock and Alan McKean