Hexagonal Architecture Relevance Example: Difference between revisions
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: | ||
<youtube t=870>ChUlRa0xsWo</youtube> | <youtube t=870>ChUlRa0xsWo</youtube> | ||
| Line 51: | Line 47: | ||
= | = 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]] | ||
Latest revision as of 13:22, 13 February 2026
- Page4 Java Code
- Page9 Component with ports -> turned version of it
- Page18 Ownership of interface
3D Animations
- https://nicescad.bitplan.com/design/c0hgnbt7
- https://nicescad.bitplan.com/design/izrua6aq
- https://nicescad.bitplan.com/design/7mahjky2
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));
}
}