How falvojr/lab-banco-digital-oo works
Project type and purpose
• This is a small Java console application that models a “Digital Bank” domain using object-oriented principles.
• Its goal is to let users deposit, withdraw and transfer money between two types of accounts (checking and savings) encapsulated in an OOP design.
File structure
• src/ contains all Java source files:
• IConta.java – the account interface
• Conta.java – abstract base class implementing common logic
• ContaCorrente.java and ContaPoupanca.java – concrete account types
• Cliente.java – represents a bank customer
• Banco.java – holds and manages a collection of accounts; orchestrates operations
• Main.java – entry point (presentation layer)
• There is no external persistence layer or configuration files; state is kept in memory.
README for architectural hints
• Emphasis on OOP pillars: abstraction, encapsulation, inheritance, polymorphism.
• No mention of databases or external services; purely an in-process domain model.
Components
a. Presentation Layer: Main.java
– CLI or console input → invokes methods on Banco
b. Service/Orchestration Layer: Banco.java
– Maintains a collection (e.g., Map<id, IConta>)
– Exposes methods createAccount(), deposit(), withdraw(), transfer()
c. Domain Model
– IConta (interface)
– Conta (abstract) implements IConta
– ContaCorrente and ContaPoupanca extend Conta
– Cliente associated with Conta (1-to-1 or 1-to-many)
d. Data/State
– In-memory collection of accounts inside Banco
– No external DB or file storage
Relationships and interactions
• Main → Banco (calls)
• Banco → IConta (manages references)
• IConta ←– ContaCorrente, ContaPoupanca (implements)
• Conta has a reference to Cliente (aggregation)
• Transfer: Banco retrieves two IConta instances and calls withdraw() and deposit()
Architectural patterns and principles
• Interface-based programming: IConta decouples code from concrete account types
• Inheritance: common code in abstract Conta
• Polymorphism: Banco treats all accounts via IConta
• Single-Responsibility: classes each have a single well-defined role
Essential elements to capture
• Clear naming of each component
• Interface vs. abstract vs. concrete distinctions
• Aggregation/composition links (e.g., account → client)