Note: This blog post was created with AI assistance to help make complex technical documentation more accessible.
π Introduction
Uniface 10.4 offers different types of components, each designed for specific purposes in your application. Think of components as building blocks β each one has a special job to do. In this guide, we'll explore all seven component types and when to use them.
β οΈ Important: All components share the same namespace, which means each component name must be unique across your entire application. You cannot have both a Dynamic Server Page and a Static Server Page with the same name like "PURCHASE_ORDER".
π Web Components
Dynamic Server Pages (.dsp) π«
Dynamic Server Pages are your go-to choice for modern, interactive web applications. They create browser-based user interfaces that feel responsive and smooth.
Key Features:
- Partial page updates β only the changed data refreshes, not the whole page
- JavaScript support for client-side processing
- Users can view, create, and modify data
- Best user experience for web applications
Example Use Case: Imagine an online shopping cart. When you add an item, only the cart section updates β you don't need to reload the entire page. That's a Dynamic Server Page in action! π
Static Server Pages (.usp) π
Static Server Pages are simpler web components that refresh the entire page with each update. While less interactive than DSPs, they're still useful for certain scenarios.
Key Features:
- Full page refresh on updates
- Simpler architecture
- Suitable for less interactive interfaces
Example Use Case: A simple form submission page where users fill out information and submit it once. After submission, the whole page reloads to show a confirmation message. π
π₯οΈ Desktop and Mobile Components
Forms (.frm) π±
Forms are presentation components for desktop and mobile applications. They run locally on the user's device and provide rich user interfaces.
Key Features:
- Runs locally on desktop or mobile devices
- Can be modal (blocks other windows) or non-modal (allows multitasking)
- Full data viewing and editing capabilities
- Native look and feel
Example Use Case: A customer management form in a CRM desktop application where sales staff can view customer details, edit contact information, and add notes. The form opens in a window and allows immediate data interaction. π₯
Reports (.rpt) π¨οΈ
Reports are specialized components designed purely for printing data. They have no user interface and cannot modify data.
Key Features:
- Print-only functionality
- No user interface
- Can run locally or remotely
- Read-only access to database
Example Use Case: Generating a monthly sales report PDF that shows all transactions. The report pulls data from the database, formats it nicely, and sends it to a printer or PDF file β no user interaction needed during the process. π
βοΈ Business Logic Components
Services (.svc) π§
Services handle application processing that doesn't require user interaction. They're the workhorses of your business logic.
Key Features:
- No user interface
- Can run locally or remotely
- Process-oriented functionality
- Reusable business logic
Example Use Case: An email notification service that runs in the background. When an order is placed, the service automatically sends confirmation emails to customers without any manual intervention. π§
Session Services (.ssv) π―
Session Services provide task-specific processing that often involves complex operations or working with multiple database tables.
Key Features:
- Task-specific processing
- Handle complex calculations
- Work with multiple entities (database tables)
- Session-level operations
Example Use Case: A shopping cart checkout service that calculates totals, applies discounts, processes payment, updates inventory across multiple tables, and generates an invoice β all coordinated operations happening together. π³
Entity Services (.esv) πΎ
Entity Services are specialized for handling data input/output operations for a single database table (entity).
Key Features:
- Single entity focus
- Data I/O operations
- Database table management
- CRUD operations (Create, Read, Update, Delete)
Example Use Case: A customer entity service that handles all database operations for the CUSTOMERS table β adding new customers, updating customer information, fetching customer data, or deleting inactive customers. Each operation is clean and focused on just one table. π€
π― Choosing the Right Component
Here's a quick decision guide:
- Need an interactive web interface? β Use Dynamic Server Pages (.dsp) π
- Need a simple web form? β Use Static Server Pages (.usp) π
- Building a desktop/mobile app? β Use Forms (.frm) π₯οΈ
- Just need to print data? β Use Reports (.rpt) π¨οΈ
- Background processing needed? β Use Services (.svc) βοΈ
- Complex multi-table operations? β Use Session Services (.ssv) π―
- Single table data management? β Use Entity Services (.esv) πΎ
π Key Takeaway
Uniface 10.4's component types give you flexibility to build different parts of your application with the right tool for each job. Remember that component names must be unique across all types β think of it like having a unique employee ID for each person in a company, regardless of their department.
By understanding these seven component types, you can architect better applications and choose the most efficient approach for each feature you build! π
Happy coding! π»
Top comments (0)