Ver 5.1 March 5, 2019
wwBusinessPro is a wrapper library around the popular wwBusiness data-access library from West Wind Technolgies, which adds some additonal functionalities that help with Parent-Child mappings that are often used in CRUD applications.
The base wwBusiness library is an ORM-like data access library for Visual FoxPro that has been around for years which allows you to read and write data from tables in an object oriented way. It supports both native FoxPro dbf tables, and SQL Server.
This wwBusinessPro library extends the base features of wwBusiness by adding these new features:
- Support for string based lookups as primary keys
- Support for multiple sets of Child records per each Parent record
- Saving the Parent Primary Key into the Child Foreign Key during the Save() operation
- Adds methods for Ordering and Reordering Child records to control the record order
- Table-based Business Object definitions for Parent and Child tables.
Other Wiki pages
In this small amount of code, we will load a single Parent record and populate (5) separate Child objects and their local cursors, and create (5) Related objects, where each one is related to the Parent by a foreign key:
See a fully documented code sample here: https://bitbucket.org/mattslay/wwbusinesspro/src/default/.Sample/wwBusinessPro_sample.prg
Example: Job Object built with wwBusinessPro
This view shows the main Job object created from the code sample above, with its Business Object Manager which loads all Child Objects and Related Objects when a new Parent is loaded. It also handles saves and deletes on all child cursors, and assigns PK/FK relations between the Parent and Child when the data is saved. You can now bind your UI form controls to the Parent object properties, and bind the Child cursors to grids, or they can be used in web development to generate web pages by reflecting over the Objects and cursors.
Business Object Dictionary - Maintenance Form
Each Parent/Child/Related object is defined in the the Business Object Dictionary Table. Each Parent object/table (P), can have on or more Child object/table (I) and Related objects (R) that are linked to their Parent object via the cParent column. All other details like the table name, key field names, etc. are all maintained in the Business Object Dictionary Table. From there the CreateWWWBO() function will create all objects and cursors.
Resources to help you use wwBusiness and wwBusinessPro:
Basic help with wwBusiness:
- Getting Started with wwBusiness (PDF): http://cullytechnologies.com/presentations/wwbusiness/cully_technologies_wwbusiness_presentation.pdf
- Full wwBusiness Documentation: http://www.west-wind.com/webconnection/wwClient_docs/_0gz17u8f4.htm
The wwBusinessPro VCX class library is documented to a Windows Help File (CHM) in the \Documentation folder of the code base.
In the Help File, you will find documentation for both the wwBusiness from West Wind, and the wwBusinessPro library wrapper written by Matt Slay.
wwBusinessPro library is a free, open source project which extends the base wwBusiness framework. You will need to purchase a license for the main wwBusiness library to use with wwBusinessPro. You can get wwBusiness as part of the Web Connection or Client Tools package at the West Wind web site. See https://webconnection.west-wind.com/docs/_0gz17u8f4.htm