jump to navigation

redundancy, design diversity and protection against mistakes within the specification August 25, 2008

Posted by crystalchangdin in education and career in Sweden.
add a comment

In an ideal world a system incorporating both redundancy and diverse design would provide good protection against both random component failure and some forms of design faults. It would not, however, provide protection against mistakes within the specification, as even diverse systems will generally be attempts to implement the same specification.

Research had shown that getting different teams to design a module does not remove the likelihood of similar faults in the implementations. The results showed that although the programs were each extremely reliable, they showed many common faults. Despite this finding, it is generally accepted that diverse design had great value in reducing common-mode failures, although it cannot guarantee freedom from such problems. Diverse design has also been shown to be of benefit in locating ambiguities within the specification, as different teams usually adopt diverse interpretations.

fault tolerence August 25, 2008

Posted by crystalchangdin in education and career in Sweden.
add a comment

6.2 Types of faults

Nature

random faults:

The primary cause of random faults is hardware component failure. Statistical analysis may make it possible to estimate the likelihood of it failing within a given period of time.

systematic faults (design faults):

mistakes in the specification of the system; mistakes in the software; and mistakes in the  hardware design

   Duration

   permanent faults:

       This kind of faults remain in existence indefinitely, or untill some corrective action is taken, are termed permanent faults. Design faults, including software faults, are always permanent, as are many hardware components.

   transient faults

   This kind of faults can appear and then disappear after a short time.

   intermittent faults

   These faults, appear, disappear and then reappear at some later time.

Extent

   localized fault

      It may affect only a single hardware or software module

   global fault

       It has effects which permeate throughout the system

MVC pattern August 22, 2008

Posted by crystalchangdin in education and career in Sweden.
add a comment

The Model-View-Controller (MVC) pattern separates the modeling of the domain, the presentation, and the actions based on user input into three separate classes [Burbeck92]:

  • Model. The model manages the behavior and data of the application domain, responds to requests for information about its state (usually from the view), and responds to instructions to change state (usually from the controller).
  • View. The view manages the display of information.
  • Controller. The controller interprets the mouse and keyboard inputs from the user, informing the model and/or the view to change as appropriate. 
  •  

    Figure 1: MVC class structure 

    Figure 2: Behavior of the passive model

    Figure 3: Using Observer to decouple the model from the view in the active model

    Figure 4: Behavior of the active model

    執行TomCat August 21, 2008

    Posted by crystalchangdin in education and career in Sweden.
    add a comment

    新增環境變數:

    variable name:  CATALINA_HOME

    variable value: C:\apache-tomcat-6.0.18

     

    命令提示字元視窗

    (1) Start Up Tomcat

     C:\Documents and Settings\user>
     C:\Documents and Settings\user> C:\apache-tomcat-6.0.18\bin\startup.bat

    (2) After startup, the default web applications included with Tomcat will be
        available by visiting:

           http://localhost:8080/

    (3) Shut Down Tomcat
     C:\Documents and Settings\user>
     C:\Documents and Settings\user> C:\apache-tomcat-6.0.18\bin\shutdown.bat

    詳細文件請看:C:\apache-tomcat-6.0.18\RUNNING.txt

    設定環境變數 August 21, 2008

    Posted by crystalchangdin in education and career in Sweden.
    add a comment

    My computer右鍵->Properties->Advanced->Environment Variables

    java August 21, 2008

    Posted by crystalchangdin in education and career in Sweden.
    add a comment

    JRE 是 JDK 的子集

    皆為Java開發工作環境tool kits

    array initializer August 14, 2008

    Posted by crystalchangdin in education and career in Sweden.
    add a comment
    • An array initializer can appear only in an array declaration.

            CORRECT!!

              int[ ] vec = {0,2,4,6}

            WRONG!!

              int[ ] vec;

              vec = {0,2,4,6};

    • An array initializer can be an element of an array initializer. For example, the following:

              int[ ][ ] matrix = { {0 , 0 , 0 , 0} , {1 , 2 , 3} } ;

    2D array August 14, 2008

    Posted by crystalchangdin in education and career in Sweden.
    add a comment

     

    matrix = new int [3][4];

    compare ” == ” and ” equals “ August 13, 2008

    Posted by crystalchangdin in education and career in Sweden.
    add a comment

    String s1 = new String(“abc”);

    String s2 = new String(“abc”);

    s1==s2 returns false, while s1.equals(s2) returns true.

    The variables s1 and s2 contain different reference values, denoting different objects. But as String, these objects are considered equal.

    advice for create new Lists August 13, 2008

    Posted by crystalchangdin in education and career in Sweden.
    add a comment

    public IntegerSet (List<Element> elements){

       this.elements = elements.copy();

       …

    }

    Use copy but not assign. Because we do not want the IntegerSet instance variable referring to the same object as the argument provided by the client. If it did, then any subsequent changes to the argument object would effect the state of the set and vice versa.