Runtime libraries in Uniface 10.4 are powerful tools that help you organize and share objects across your entire application. Let's explore what they are and how they can make your development life easier! π
π― What Are Runtime Libraries?
Think of runtime libraries as a shared storage space where you keep objects that all your application components can use. Instead of creating the same menu or message over and over again in different components, you create it once and store it in a runtime library.
These libraries are packaged into special files called UAR files (Uniface Archive files with the extension .uar). The great thing about UAR files is that you can easily copy them to any server or client machine, making deployment much simpler! πΎ
π οΈ What Can You Store in Runtime Libraries?
Runtime libraries can hold many different types of objects:
π Messages and Help Texts
Store all your application messages in one place. These are language-specific, which means you can have different versions for different languages. For example:
- English: "Please enter your username"
- German: "Bitte geben Sie Ihren Benutzernamen ein"
- French: "Veuillez saisir votre nom d'utilisateur"
π§ Global Variables
These are typed variables that any ProcScript in your application can access at runtime. Think of them as application-wide settings or values that need to be available everywhere.
π Global ProcScripts
Write your code once and call it from anywhere! Global ProcScripts are code modules that can be used by any component in your application. Perfect for common functions like validation or data formatting.
π±οΈ Desktop-Specific Objects
Some objects are designed specifically for desktop applications:
- Menu Objects: Define the menus for your desktop app
- Panels: Create toolbars with buttons and icons
- Drag-and-Drop Formats: Configure how drag-and-drop works in your application
π¨ Visual Elements
Glyphs are images in Uniface's proprietary format. You can use them as:
- Background images in forms
- Icons in widgets and buttons
- Menu icons
π Language Support
Language Setups help you customize your application for different regions:
- Date and time formats (MM/DD/YYYY vs DD.MM.YYYY)
- Error messages in different languages
- Default button texts
- Special features like Japanese era definitions (Kanji-specific)
β¨οΈ Translation Tables
- Device Translation Tables: Map Uniface output to printer or character-based screen formats
- Keyboard Translation Tables: Map user keyboard input to Uniface functions
π Dynamic Language Switching
One powerful feature is the ability to switch libraries or languages dynamically at runtime. You can do this using ProcScript with special variables:
-
$variation
- Specifies the library name -
$language
- Specifies the language
This means your application can automatically show the right language based on user preferences! π
π¦ Deployment Benefits
Using runtime libraries and UAR files offers several advantages:
- Fast Performance: UAR files are optimized for quick access
- Easy Updates: Change a message once, and it updates everywhere
- Simple Distribution: Just copy the UAR file to deploy
- Organized Code: Keep global objects separate from component-specific code
π‘ Practical Example
Imagine you're building a multi-language order processing system. Instead of hardcoding messages in each form, you create a message library:
- Library: OrderMessages.uar
- Message ID: ORDER_CONFIRMED
- English: "Your order has been confirmed"
- German: "Ihre Bestellung wurde bestΓ€tigt"
Now, when a German user places an order, Uniface automatically displays the German message. When updating this text, you only change it in one place! β
π Best Practices
- Group related objects together in the same library
- Use clear naming conventions for your libraries
- Keep language-specific content in separate libraries
- Test your UAR files in a development environment before deploying
- Document what each library contains for your team
π Conclusion
Runtime libraries in Uniface 10.4 are essential for building maintainable, scalable applications. They help you organize global objects, support multiple languages, and simplify deployment. By understanding how to use them effectively, you can create cleaner, more efficient Uniface applications! π
π Note: This blog post was created with the assistance of AI to help explain Uniface 10.4 runtime libraries in a clear and accessible way.
Top comments (0)