238
Views
2
Comments
Blocks

"Every single use of a block is an instance of the block."

During Learning of OutSystems "Block", I got this line, can't able to understand.


Screenshot (11).png
2024-01-18 12-42-28
Bogdan Boglea

Hey Abhishek,


You can see this as an analogy with classes and objects in OOP. The WebBlock you define is like a class, but everytime you place the webblock inside a screen (or another webblock) it's like defining an object of that class, so every webblock is independent of the other webblocks,  it's just a piece of reusable UI & logic that can be independently used in different parts of your application.

Hope I made it a bit more clear.


Regards,
Bogdan

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi Abishek,

A block is just like a template, it doesn't exist yet unless it's used. So every time you use a block, OutSystems adds it to the screen it's used on, so every use is an "instance".

This is a definition of "instance":

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.