The temptation is to make things like “name” that will be different for every entity into a parameter on the factory. Especially if you wanted to make sure that all entities had one. And for me, it’s quite common that my factory methods take at least name and position… though position is probably best set last.
If you plan to want to override things that you would already be setting on the prefab then that indicates that you may really want more than one prefab. For example, if Peasant normally has Strength(1) and you want to create a Peasant with an overridden Strength(2) that may indicate it’s not a regular peasant anymore.
…and if you know that you will never “override” of “conflict” components like that then you could have your factory method take a list of extra components as a convenience. (Which also means if you have an empty prefab you have a convenient factory that will create an entity and set a bunch of components from a single call already.)
So in some ways, it depends on the use-case.
The benefit of groovy as the prefab format is that you can put logic in there and I’ve done that, too… but it’s generally very generic logic that would make sense for almost any type of entity. Like generating a Name or picking a model info based on some other criteria or something (maybe tall peasant versus short peasant or whatever… but it’s a very contrived example.)
So: it depends.