{{theTime}}

Search This Blog

Total Pageviews

Factory Method Design Pattern Java Implementation

    interface JavaCertification {

        public JavaCertification getCertificate() ;

    }
    class OCJPCertification implements JavaCertification {     
        public JavaCertification getCertificate(){         
            return new OCJPCertification() ;
        }
    }

    class OCWCDCertification implements JavaCertification {     
        public JavaCertification getCertificate(){         
            return new OCWCDCertification() ;
        }
    }

    class CertificationBuilder {

        public CertificationBuilder() {}

        public JavaCertification getCertifcate(String certificate){         
            if(certificate.equalsIgnoreCase("OCJP")){
                return new OCJPCertification() ;
            }else if(certificate.equalsIgnoreCase("OCWCD")){
                return new OCWCDCertification() ;
            }
            return null ;
        }
    }


No comments:

Kafka Consumer Parallelism

Kafka Parallel Consumer Options: Key-level parallelism:  Multiple threads process the messages from a single partition in parallel while ma...