Persistance Layer - Jonaath/EmergingTechnologiesMendix GitHub Wiki

Application Persistence

In this application, data persistence is based on an automatically generated Domain Model. To achieve this, we used Maia (domain model generator). As discussed in the Mendix presentation, providing a clear and precise prompt is essential to obtaining a quality result.

Below is the prompt we used:

create me a Domain model that have those entities

1. User

  • Username (String, Unique)
  • Email (String, Unique)
  • FirstName (String)
  • LastName (String)
  • PhoneNumber (String)
  • UserType (String)

2. Product

  • Name (String, Indexed)
  • Description (String, Long)
  • Price (Decimal)
  • Quantity (Integer)
  • CreatedDate (DateTime)

3. Category

  • CategoryType (String)

4. ProductImage

  • ImageFile (FileDocument)

5. Order

  • OrderNumber (String)
  • OrderDate (DateTime)
  • TotalAmount (Decimal)

6. OrderItem

  • Quantity (Integer)
  • Price (Decimal)
  • Subtotal (Decimal)

7. ProfileImage

  • ImageFile (FileDocument)

Results

Using this prompt, Maia generated the following data model (as shown in the screenshot above). It includes the following entities, each corresponding to the specified requirements:

  1. User: Manages user identification and contact information.

  2. Product: Contains information related to products.

  3. Category: Allows products to be classified by category type.

  4. ProductImage: Stores image files associated with products.

  5. Order: Represents an order placed by a user.

  6. OrderItem: Details each item included in an order.

  7. ProfileImage: Stores a user’s profile picture.

This Domain Model reflects the basic structure required to manage users, products, orders, and associated images. The use of Maia greatly simplified the generation of this model.