ANSWERS 1 SPC 2309 Component Programming Year III Supplementary & Special
ANSWERS 1 SPC 2309 Component Programming Year III Supplementary & Special
b) Study the diagram below and answer the questions that follows
i. Outline the activities taking place in the system presented above (4 marks)
1. User Interaction: A user interacts with the system, potentially browsing the
menu list using the "Menu List" component.
2. Order Placement: The user places an order, triggering interactions with the
"Place Order" component and possibly the "Food Database" or "Transaction
Database" for order details and storage.
3. Payment Processing: The user makes a payment using the "Payment"
component, possibly connecting to payment gateways for external processing.
4. Order Fulfillment: Upon successful payment, the system might interact with
the "Food Database" and "Delivery" components to prepare and deliver the
food.
e) Explain role of interface in component model service giving a valid example (4 marks)
Example: In an online library system, you might have a Book component and a
Search component.
Advantages of Interfaces:
1. Local Interfaces:
2. Remote Interfaces:
Benefits of Interfaces:
b) Create a UML diagram that can be used to represent the organization, planning and
execution of a seminar in a university. The seminar intends to have attendance from
students and staff within the university premises in a scheduled time. The administration
will need to approve the seminar.(12marks)
Classes:
Relationships:
Speaker Notes:
This UML Class Diagram depicts the key entities involved in organizing, planning,
and executing a seminar at a university. It shows that:
● A seminar has details like title, description, date, time, location, and speaker
information.
● Students and staff can register for the seminar (optional staff involvement).
● The administration may need to approve the seminar before it can be held.
● A registration process can be implemented to track student and staff
enrollments.
● The topic of the seminar can be included as an optional class.
Additional Considerations:
● You might add a Room class to represent the physical space where the
seminar will be held.
● A Schedule class could be included to manage potential conflicts with other
events.
● Consider adding a Notification class or mechanism to inform registered
participants of the seminar's approval or any updates.
● Depending on the complexity of the seminar, additional classes might be
necessary, such as Speaker and Materials to manage speaker
information and seminar materials.
Components
Objects
Interfaces in component models provide essential properties for building robust and
maintainable systems:
Concept:
Java Beans:
The choice of protocol depends on the specific web service and your project
requirements.
Architecture:
Benefits:
Drawbacks:
Examples:
Description:
Enterprise JavaBeans (EJB) are a category of component model services built upon
Java Beans specifically designed for developing distributed, transactional enterprise
applications. They offer features beyond basic Java Beans to address the needs of
complex enterprise systems.
Key Characteristics:
Benefits:
● Java Beans are simpler and lightweight, suitable for general use in any Java
application.
● EJBs are more complex and designed specifically for enterprise applications
with features like transactions and container management.
In conclusion, Enterprise Java Beans (EJB) offer robust functionalities for building
distributed, transactional enterprise applications. Their managed lifecycle, security,
and transaction support make them a valuable choice for complex systems
development within the Java ecosystem.