Top Banner

of 14

SA Excercise Presentation Version 2

May 30, 2018

Download

Documents

Start123456
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
  • 8/14/2019 SA Excercise Presentation Version 2

    1/14

    tudent Score Evaluation

    Translation ADL toTranslation ADL to

    Programming languagesProgramming languages

  • 8/14/2019 SA Excercise Presentation Version 2

    2/14

    adt

    adt ado

    f

    score

    student calculateScore

    conversionTab

    le

    Translation ADL to Programminglanguages

    Student Score Evaluation

    .1 F

    .2 ado

    .3 adt

    .4Genericity

    .5.General U

    .6 Local

    .U

    .7Subsystem

    ADL

  • 8/14/2019 SA Excercise Presentation Version 2

    3/14

    Part I: How system works

    Purpose: To demonstrate how to

    translate Architecture Languagesconcept to JAVAThere may be not fully 100% practical

    Student: Generic adt module Store information about student: name,

    birthday, nationality, score (included

    as nested class) And one generic property: result, which

    could be character like A, or number3.80, or string Excellent

    And all corresponding get, set method

  • 8/14/2019 SA Excercise Presentation Version 2

    4/14

    Score : Adt module Store core for each subject, i.e,

    mathematic, physic, chemistry

    And all corresponding get , set method

    Is nested class inside student class CalculateScore: functional module

    Procedure to calculate GPA for eachstudent

    Procedure to evaluate students resultbase on their GPA: determine A, or3.80 or Excellent...

    ConversionTable: Ado module

    reference table to convert GPA to result,i.e

  • 8/14/2019 SA Excercise Presentation Version 2

    5/14

    Student module local import from Scoremodule to store and get the score foreach subject

    Student module general import fromCalculateScore module to calculateGPA and classify the students result

    CalculateScore module general import

    from ConversionTable to convert GPAto corresponding evaluation

    All of the modules and relation betweenthem is put on one subsystem. This

    subsystem public the interface ofstudent and calculatescore module

  • 8/14/2019 SA Excercise Presentation Version 2

    6/14

    Translation ADL to Programminglanguages

    Student Score Evaluation

    : >art II Translate to JAVA Student( )eneric adt

    General

    Subsystem

    Interface

    bodyADT

  • 8/14/2019 SA Excercise Presentation Version 2

    7/14

    Translation ADL to Programminglanguages

    Student Score Evaluation

    : >art II Translate to JAVA Student( )eneric adt

    < > =tudent string obj new< >();t ud en t s tr in g< > =tudent int obj new< >();tudent int

    student obj = new student();student obj = new student();

    Genericity

  • 8/14/2019 SA Excercise Presentation Version 2

    8/14

    Translation ADL to Programminglanguages

    Student Score Evaluation

    : >art II Translate to JAVA Locality& Generality

    Locality

    Generality

  • 8/14/2019 SA Excercise Presentation Version 2

    9/14

    Translation ADL to Programminglanguages

    Student Score Evaluation

    : >art II Translate to JAVA&unctional GeneralityInterface

    body

    General

    Funtional

  • 8/14/2019 SA Excercise Presentation Version 2

    10/14

    Translation ADL to Programminglanguages

    Student Score Evaluation

    : >art II Translate to JAVA ADO

    ADO

    Using Singleton pattern

  • 8/14/2019 SA Excercise Presentation Version 2

    11/14

    Part III: Summary

    ADT: is template used to create manysimilar objects which has identicalstructure

    Translated to Java includes 2 class:interface class and implementationclass (or body)

    ADO: is a Single entry or Singlecollection with specific accessoperations. From architecture view, ithas fixed number of objects, i.e, 1 or

    2

  • 8/14/2019 SA Excercise Presentation Version 2

    12/14

    Part III: Summary

    F module: is a module containsoperation(s) that being used by othermodule(s) to transform or calculate theinput data to the correct output data

    implementation class (or body) containsonly operation(s), no data

    Generality: is a using relationshipbetween modules in design level.

    With classs visibility qualifier is public, soany other classes can see and call theclass (multiple uses).

    Can also use when several classes from

    different layer or subsystem want toaccess the same class.

  • 8/14/2019 SA Excercise Presentation Version 2

    13/14

    Part III: Summary

    Locality: is a contain relationship betweenmodules in design levelTranslated to Java using nested class with

    suitable modifiers

    Genericity: Generic unit is a template, andby instantiation, we get a unit. Thereforegeneric parameter needed to specify typesfor instantiating. It is a compile-time

    mechanism Generics are an advanced feature of Java 1.5 Programmers can instantiate versions of

    classes using some type as a parameter,e.g . . . . a stack of int and or a stack of

    floats or a stack of Objects Subs stem:

  • 8/14/2019 SA Excercise Presentation Version 2

    14/14

    Part III: Summary

    Subsystem: groups related modules intoa new coarser unit that support betterunderstanding, reuse component,information hiding, and maintainsystem.

    Package mechanism is used to mapsubsystem component in ourarchitecture intoJava code.

    Modules that include in the samesubsystem have to write the samepackage declaration (package name).

    A package name is the same as thedirector folder name which contains