mirror of
https://github.com/microsoft/BCQuality.git
synced 2026-10-07 23:56:56 +01:00
Add 18 more community AL/BC patterns across appsource, data-modeling, error-handling, security, style, testing, ui, upgrade, and web-services
Second contribution from CURABIS ApS, generalized from patterns observed across real AppSource/PTE development. Cross-checked against the current microsoft/knowledge corpus before opening; several originally-drafted candidates were dropped as duplicates of existing files.
This commit is contained in:
parent
07e324ddbc
commit
a4d85c3e9e
50 changed files with 1262 additions and 0 deletions
|
|
@ -0,0 +1,44 @@
|
|||
---
|
||||
bc-version: [all]
|
||||
domain: data-modeling
|
||||
keywords: [blob, media, mediaset, picture-field, image-field, table-design]
|
||||
technologies: [al]
|
||||
countries: [w1]
|
||||
application-area: [all]
|
||||
---
|
||||
|
||||
# Pictures must be stored in a Media/MediaSet field, not BLOB
|
||||
|
||||
## Description
|
||||
|
||||
`BLOB` is still a valid AL field type for arbitrary binary data, but it is
|
||||
not the right choice for storing pictures or images. The current
|
||||
recommendation is the `Media` field type for a single image, or
|
||||
`MediaSet` when a record needs several image variants (e.g. multiple
|
||||
sizes). Media/MediaSet integrate with the platform's picture control, the
|
||||
media repository, image caching, and thumbnail generation — none of which
|
||||
a plain `BLOB` field gets. A `BLOB` field storing a picture works, but it
|
||||
is the legacy approach: no caching, no thumbnail support, and no
|
||||
integration with the standard picture controls used across Business
|
||||
Central pages.
|
||||
|
||||
`BLOB` remains the correct choice for genuinely arbitrary binary payloads
|
||||
that are not images and don't benefit from the media pipeline (e.g. a raw
|
||||
file attachment blob unrelated to picture rendering).
|
||||
|
||||
## Best Practice
|
||||
|
||||
Use `Media` (or `MediaSet` for multiple image variants) for any field that
|
||||
holds a picture.
|
||||
|
||||
See sample: `pictures-must-use-media-not-blob.good.al`.
|
||||
|
||||
## Anti Pattern
|
||||
|
||||
A `BLOB` field named "Picture" compiles and stores the image bytes, but
|
||||
it misses the picture control integration, caching, and thumbnail
|
||||
generation that a `Media`/`MediaSet` field provides for free — the anti
|
||||
pattern is choosing `BLOB` for image storage out of habit rather than
|
||||
recognizing that the field is holding a picture, not generic binary data.
|
||||
|
||||
See sample: `pictures-must-use-media-not-blob.bad.al`.
|
||||
Loading…
Add table
Add a link
Reference in a new issue