Author Topic: Fragment vs Template  (Read 1647 times)

gash272

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Fragment vs Template
« on: July 04, 2024, 04:53:30 pm »
1. I am building out a series of reports (both Virtual and Custom) and it seems in most cases I can use a fragment or template interchangeably.
  • Is that true or do they have specific use cases and should be treated as such?
  • If so, when is it advised to use which?
I currently used fragments when I need to use a custom query to return specific information, but then I use templates for everything else, resulting in a "master document" with templates inside templates and fragments inside those.

2. In addition, is there a difference on which type of template I copy from the ones that ship with EA e.g. System templates, EA Documentation > Publication templates, Document Templates (found in the resources window).
Or do they all function the same way, but are just grouped according to which document type they were designed for (e.g. Standard, Virtual, Custom).

The reason I ask is that I would ideally want as few templates as possible with maximum reuse, so design 1 template that can be used in both a virtual and custom document. Is reuse in templates smart design or rather create very specific templates for the document type I need.

TIA

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13400
  • Karma: +566/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Fragment vs Template
« Reply #1 on: July 04, 2024, 05:20:59 pm »
Only fragments can be called as part of a template.

Regular templates can't.

Only fragments can use SQL/script, etc.. as the source of the content.

Each template is the same. What I usually do is create an empty template that I use as "template" for all my new templates.
This empty template has the right size, borders and styles and if I need a new template or fragment, I copy this one.

I tend to keep my templates as small and simple as possible, which also means there little to no re-use. Experience shows that more often then not the use-cases where re-use looked like a good idea, turn out to diverge somewhere along the way.
The risk is that you change the template, without realizing that it is being re-used, and you mess up the other documents.

Geert


gash272

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Fragment vs Template
« Reply #2 on: July 08, 2024, 09:25:58 pm »
Thank you, I appreciate, and will apply, your advice.

Do you have a clear way of distinguishing the different types I asked about in point 2, or are all templates in EA actually the same?

"2. In addition, is there a difference on which type of template I copy from the ones that ship with EA e.g. System templates, EA Documentation > Publication templates, Document Templates (found in the resources window).
Or do they all function the same way, but are just grouped according to which document type they were designed for (e.g. Standard, Virtual, Custom)."
« Last Edit: July 08, 2024, 09:28:07 pm by gash272 »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13400
  • Karma: +566/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Fragment vs Template
« Reply #3 on: July 08, 2024, 09:31:31 pm »
Since you can change the type of a template, I think the are under the hood basically the same thing.

Geert