Hexagonal Architecture Relevance Example: Difference between revisions

From BITPlan cr Wiki
Jump to navigation Jump to search
(pushed from cpsa-f by wikipush)
 
m (Wf moved page RQ 2026-02-03/blue to Hexagonal Architecture Relevance Example without leaving a redirect)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
{{Group|course=2026-02-03|name=thumbs_up_blue|exercise=Requirements_Exercise/en#Software_for_capturing_books.2C_Blu-rays.2C_etc}}


* {{Link|target=Requirements_Exercise/en}}
https://docs.google.com/spreadsheets/d/1zgT36ZAHIHace2nUwtbzDuLvC6-r0Qbxdh5_8WjDGXY/edit?usp=sharing


<youtube t=870>ChUlRa0xsWo</youtube>
<youtube t=870>ChUlRa0xsWo</youtube>
Line 51: Line 47:




= Result =
= Relevance =
== TestSheet ==
[https://docs.google.com/spreadsheets/d/1zgT36ZAHIHace2nUwtbzDuLvC6-r0Qbxdh5_8WjDGXY/edit?usp=sharing Tax Test data]
 
 
[[File:T2_Relevance.JPG|600px]]
[[File:T2_Relevance.JPG|600px]]


[[File:T1_exercise_result_RQ_02.JPG|400px]]
[[File:T1_exercise_result_RQ_02.JPG|400px]]
[[Category:Exercise]]
[[Category:Planning]]

Latest revision as of 13:22, 13 February 2026


  1. Page4 Java Code
  2. Page9 Component with ports -> turned version of it
  3. Page18 Ownership of interface

3D Animations

Code

interface ForCalculatingTaxes {
    double taxOn(double amount);
}

interface ForGettingTaxRates {
    double taxRate(double amount);
}

class FixedTaxRateRepository implements ForGettingTaxRates {
    public double taxRate(double amount) {
        return 0.15;
    }
}

class TaxCalculator implements ForCalculatingTaxes {
    private ForGettingTaxRates taxRateRepository;
    
    public TaxCalculator(ForGettingTaxRates taxRateRepository) {
        this.taxRateRepository = taxRateRepository;
    }
    
    public double taxOn(double amount) {
        return amount * taxRateRepository.taxRate(amount);
    }
}

class Main {
    public static void main(String[] args) {
        ForGettingTaxRates taxRateRepository = new FixedTaxRateRepository();
        ForCalculatingTaxes myCalculator = new TaxCalculator(taxRateRepository);
        System.out.println(myCalculator.taxOn(100));
    }
}


Relevance

TestSheet

Tax Test data


T2 Relevance.JPG

T1 exercise result RQ 02.JPG