Introduction to Software Architecture
Software Architecture - high-level structure of a software system that defines:
- How the system is organized
- What components it contains
- How those components interact
- How responsibilities are divided
Good architecture:
- Makes systems easier to maintain
- Improves scalability
- Reduces development cost
- Supports team collaboration
- Improves system reliability and security
Poor architecture:
- Difficult debugging
- Slow development
- Frequent Failures
- High technical debt
Component - reusable, independent parts of a system with specific function.
Example: User Interface Module, Database Module, Authentication Module, Payment
Processing Module, Reporting Module
User Interface (UI) Module
Definition:
- part of the system that allows users to interact with the software.
Explanation:
- Displays information to users (forms, buttons, dashboards, menus)
- Collects user input (keyboard, mouse, touch)
- Sends user actions to the system’s logic layer
- Does not process business rules or store data directly
Examples:
- Login screen, registration form, dashboard, mobile app screens
Technologies:
- Desktop: JavaFX, Swing, WPF, WinForms
- Web: HTML, CSS, Javascript, React
- Mobile: Flutter, Android UI, Swift UI
Importance:
- A good UI improves: usability, user satisfaction, productivity, error reduction
Database Module
Definition:
- Manages how data is stored, retrieved, updated, and deleted in the system.
Explanation:
- Communicates with the database server
- Executes SQL or queries
- Ensures data consistency and integrity
- Handles backups and transactions
Examples of stored data:
- User accounts, orders, payments, logs, reports
Technologies:
- MySQL, postgreSQL, SQL server, mongoDB
- ORM tools (hibernate, entity framework)
Importance:
- Without this module: no data persistence, no user accounts, no history or reports
Authentication Module
Definition:
- Verifies the identity of users
Explanation:
- Check usernames and passwords, Handles login and passwords, Manages sessions
or tokens (JWT), Supports multi-factor authentication (OTP, biometrics)
Functions:
- Password hashing, account lockout, role checking (admin, user), session expiration
Examples:
- Login system, google/facebook sign-in, two-factor authentication
Importance:
- Prevents unauthorized access, protects sensitive data, ensures system security
Payment Processing Module
Definition:
- Handles financial transactions
Explanation:
- Connects to payment gateways, validates payments, confirm transactions, record
payment history, handles refunds and failures
Examples:
- credit/debit card payments, gcash, paypal, stripe, subscription billing
Key Responsibilities:
- Secure transmission (SSL/TLS), fraud detection, compliance (PCI-DSS)
Importance:
- Enables e-commerce, ensures trust, protects financial data
Reporting Module
Definition:
- Generates summaries and analytics from system data
Explanation:
- Retrieves data from the database, processes statistics, displays charts, tables, and
PDF’s, supports export (Excel, PDF)
Examples:
- Sales reports, user activity reports, inventory reports, financial summaries
Tools:
- Chart libraries, PDF generators, Excel exporters
Importance:
- Helps management analyze performance, detects trends and problems
Summary
UI Module - user interaction
Database Module - data storage
Authentication Module - user identity verification
Payment Module - handle transactions
Reporting Module - data analysis & summaries
Characteristics of Good Components
- Single responsibility
- Loosely coupled
- Highly cohesive
- Reusable
- Testable independently
Layered Architecture - organizes a system into horizontal layers, where each layer has a
specific role.
Common layers:
1. Presentation layer (UI layer) - handles user interaction, displays data, collects user
input (examples: desktop forms, web pages, mobile screens)
2. Business logic layer (application layer) - contains rules and workflows, processes
data, validates input, makes decisions
3. Data access layer - communicates with databases, performs CRUD operations,
handles queries and storage
4. Database layer - stores system data permanently
Benefits of Layered Architecture
- Easy to maintain, clear separation of concerns, easier testing, flexible upgrades,
better security