Definition of Component-Based Architecture
Which statement best describes component-based architecture in software development?
- An approach where software is built by assembling independent, reusable components with well-defined interfaces
- A style where all features are coded in one large file for maximum speed
- A method that only focuses on database tables and ignores code structure
- A technique where user interface code is mixed with data storage in a single class
- A process of randomly splitting code into parts called compnents
Primary Benefit
What is a primary benefit of using components in software design across multiple projects?
- Improved reusability across projects
- Guaranteed real-time performance under any load
- Increased coupling between modules
- Harder unit testing due to hidden boundaries
- Reusablity without documentation
Well-Defined Interfaces
In component-based architecture, what does having a well-defined interface mean for a component?
- A clear contract of inputs, outputs, and behavior that other components rely on
- A list of private variables that no other code can see
- A visual button panel drawn on the screen
- A shared global namespace that all components can modify
- An interfase file that includes every internal detail
Communication Between Components
How do components typically communicate with each other in a component-based system?
- Through published interfaces or contracts rather than accessing internal state directly
- By editing each other's source code at runtime
- By sharing the same global variables for speed
- Through undocumented side effects only
- By copying and pasting methods between classes
Loose Coupling Scenario
Which scenario best demonstrates loose coupling in a component-based shopping app?
- Replacing a payment component without modifying the shopping cart when the interface stays the same
- Editing every screen in the app because a button color changed
- Rewriting the database schema to adjust the font size in the checkout page
- Hard-wiring the payment component to call private methods in the cart
- Using a single god-class to hold payment, cart, and user profile logic
Cohesion and Responsibility
Which statement about component granularity and responsibility is true in component-based architecture?
- Components should be cohesive units that encapsulate a specific responsibility
- Components should include as many unrelated features as possible to reduce file count
- Every individual function must be a separate component
- Granularity is fixed by the programming language and cannot be designed
- Granularity refers to the graphical size of the component on the screen
Deployment Flexibility
Are components always deployed as separate processes or services in a component-based system?
- No, components can be libraries within the same process or separately deployed services
- Yes, every component must run in its own server
- Yes, components are always remote and never in-process
- No, components can only be global variables in a single script
- Sometimes, but only if they are named with a 'Service' suffix
Assembly and Composition
What practice is commonly used to assemble an application from multiple components?
- Composition and configuration to wire components together
- Deep inheritance chains for every feature
- Copy-pasting code across modules to share logic
- Manual byte-level memory layout tuning for each component
- Compostion without any configuration
Interface Stability
What is a likely consequence if a component's interface changes unexpectedly in a released system?
- Dependent components may fail because they rely on the original contract
- All dependent components will auto-update magically at runtime
- Overall performance will double due to fewer methods
- Security is automatically strengthened by the change
- Only the interfase filename needs updating while behavior stays identical
Testing in Isolation
Why is testing often simpler in a component-based architecture when using mocks or fakes?
- Each component can be tested in isolation with mocked dependencies
- All components must be run together for any test to pass
- Mocking is unnecessary because components share global state
- Components cannot be tested without a full production environment
- Isolated tests are slower than end-to-end tests by definition