Ir al contenido principal

Entradas

Java Fundamentals - Persisting Objects

Serializing Storing an objet-graph to a byte stream Deserializing Restoring an objet-graph from a byte stream Serializing an Object ObjectOutputStream ObjectOutputStream out = new ObjectOutputStream( Files.newOutputStream (Path.get( filename )) ); out.writeObj ( object ); Deserializing an Object ObjectInputStream ObjectInputStream ois = new ObjectInputStream( Files.newInputStream (Path.get( filename )) ); ois.readObj ( ); Creating class version compatibility In a propmt inside /bin from our JDK Type:>   serialer  CLASS_PATH(Ej. com.comp.class) or Type: serialer -show  To have a GUI Delcare the field serialVersionUID as private static final long serialVersionUID = (Result from previous step); As long as all our classes contains the same serialVersionUID number will be compatible among them. Compare version using Reflection Once you get the ObjectOutputStream you can start using reflection. ...

Java Fundamentals - Annotations

Annotations Act as a metadata Preceded by @ @Override Check that the method signature override an interface method otherwise the compiler will send an error. @Deprecated The compiler indicate that this method is deprecated @SuppressWarnings("deprecation") Avoid that the compiler indicate the use of a deprecated method @Retention To indicate the availability according to the RetentionPolicy Values Java Source - Exist only in source file / Discarted by compiler Class - (Default value) Compile into the class file / Discarted by runtime Runtime - Loaded into runtime / Accesible with reflection @Target Define the elements where the annotation can be used: Target(ElementType.CONSTRUCTOR) Target(  { ElementType.CONSTRUCTOR,  ElementType.METHOD, ElementType.TYPE }) Create own annotations Declare the attibutes as methods Setting is similar to fields Declare annotation @Target(ElementType.TYPE) @...

Java Fundamentals - Reflection

Runtime information getClass method;  get the class description Class<?> c = obj.getClass(); c.getSimpleName(); Class.forName passing fully qualified type name c.forName("quelified_full_name") Class<?> c =  Class.forName("com.company.Bank") typeName.class getModifiers Return the class modifiers: public, private, protected, final int modifiers = c.getModifiers(); if( Modifier.isPublic(modifiers) )   System.out.println("Is a public method") Type Members Types declared & members only (Public, protected, private) getDeclaredFields getDeclaredMethods getDeclaredConstructors Type's declared & inherited members (Public only) getFields -  Return Field[] for(Field f: arr)     System.out.println(f.getName() +" " + f.getType() ); getMethods - Return Methods[] To avoid methods from the Object class   Methods[] me = c.getMethods();   for(Meth...

Java Fundamentals - Threads

Threads ExecutorService Creates a thread pool and wait until all the elements had completed his job ExcecutorService es = Executors.newFixedThreadPool( number_of_threads_to_work_); submit add and execute the thread es.submit( thread_class ); Avoid to add more work to the ExecutorService es.shutdown() Synchonized To be used in a method to a piece of code to make not thread safe classes in safe classes to be used by threads public void synchonized add(number ){    // This method will be blocked to be used by one thread at the time } public void add(){   //   synchonized ( number ) {    // The code inside this block will be tread safe  // The code can inlcude synchonized methods    } } Blocking Queues LinkedBlockingQueue PriorityBlockingQueue

SCRUM Master Certified - Quality / Risk

Quality Quality management is facilitated though three interrelated activites; Quality planning Quality control Execute the planned quality activities Quality assurance Evaluation of processes and standards that govern quality management in a project  Risk Risk management consists in 5 steps: Risk identification Risk assessment Risk prioritization Risk migration Risk communication

SCRUM Master Certified - SCRUM Principles / Aspects / Roles

SCRUM Principles  There are 6 principles that are the core guidelines and are mandatory. Empirical Process Control Backup the 3 main ideas: Transparency Inspection Adaptation Self-Organization Rather than Command & Control Collaboration Advocates project management as a shared-value creation process Value based Priorization Maximum business value Time Boxing Time is a limited constraint Iterative Development These principals respond to the questions: Who, What, Where, When, How much SCRUM Aspects There are 5 Scrum aspects Organization Business Justification It is important perform a business assestment before start the project to undestand the business need for a change, new product, etc.. Quality Ability of the completed product or deliverables to meet the Acceptance Criteria and achieve the business value expected by the customer. Change SCRUM welcome change by using short iterative sprints Risk ...

SCRUM Master Certified - SCRUM Principles / Aspects /

SCRUM Principles There are 6 principles Empirical Process Control Backup the 3 main ideas: Transparency Inspection Adaptation Self-Organization Rather than Command & Control Collaboration Advocates project management as a shared-value creation process Value based Priorization Maximum business value Time Boxing Time is a limited constraint Iterative Development These principals respond to the questions: Who, What, Where, When, How much SCRUM Aspects