Note: This blog post was created with AI assistance.
🎯 What Are Global Object Libraries?
In Uniface 10.4, libraries are containers that help you organize and manage reusable components. Think of them as toolboxes where you store global objects like menus, panels, translation tables, and other resources that you want to use across multiple applications.
🛠️ Why Create Custom Libraries?
Creating your own libraries gives you several benefits:
- ✅ Keep your code organized and maintainable
- ✅ Reuse common components across different projects
- ✅ Share resources between team members
- ✅ Separate application-specific objects from system-wide resources
📝 Step-by-Step Guide
Step 1: Open the Library Editor
Start by launching the Uniface IDE (Integrated Development Environment). Navigate to More Editors and select the type of object you want to create. For example, if you want to create a library for menus, select the menu editor.
Step 2: Create a New Library
When the Open Library dialog appears, you will see a list of existing libraries. To create a new one:
- Click the + button
- Enter a meaningful Library Name
- Add an optional Description to help identify the library’s purpose
Step 3: Choose the Right Name 💡
Naming is important! Here are the key rules:
- SYSTEM_LIBRARY: Use this name if your library will be used by all your Uniface applications
- Custom names: For project-specific libraries, choose names that clearly describe their purpose (like CUSTOMER_MENUS or REPORTS_LIBRARY)
- ⚠️ Never use USYS: This library is reserved for Uniface’s internal use and may be overwritten during updates
Step 4: Confirm and Start Working
After entering the name, click OK. If the library doesn’t exist yet, you’ll be asked to confirm its creation. Click Yes to proceed.
For certain object types (like menus or panels), you’ll need to create an initial item and click OK again. The library editor will then open, ready for you to add and configure your objects.
🎨 Practical Example
Let’s say you’re building a customer management system. You might create:
- CUSTOMER_MENUS: A library containing all menu definitions for customer-related screens
- CUSTOMER_PANELS: A library with reusable panel layouts for customer data entry
- TRANSLATIONS_DE: A library holding German language translations for your application
⚠️ Important Things to Remember
Avoid the USYS Library: The USYS library is Uniface’s internal library. When you upgrade Uniface to a new version, objects in USYS may be deleted and replaced. Always create your own libraries for custom objects to prevent losing your work.
Use Descriptive Names: Choose library names that clearly indicate their content and purpose. This makes maintenance easier, especially when working in teams.
🚀 What’s Next?
Once you’ve created your library, you can start adding objects to it. Each library can contain multiple items of its specific type. You can then reference these objects from your components, making it easy to maintain consistent behavior across your entire application.
🎓 Summary
Creating custom libraries in Uniface 10.4 is straightforward:
- Open the appropriate editor from More Editors
- Click the + button to add a new library
- Give it a meaningful name (avoid USYS)
- Confirm and start adding your objects
Libraries are a powerful way to organize your Uniface applications and promote code reuse. With proper naming and organization, they become an essential tool in your development workflow. Happy coding! 🎉