I'm currently reading the book "Topoi: The Categorial Analysis of Logic" by Robert Goldblatt, and in chapter 3.11, in order to define limits and co-limits he defines a diagram in a category as follows:
Definition 1:
By a diagram $D$ in a category $\cal C$ we simply mean a collection of $\cal C$-objects $(d_i)_{i\in I}$ together with some $\cal C$-arrows $g:d_i\to d_j$ between certain objects in the diagram.
However, when I looked at the same topic in other books, they all defined a diagram in a category in the following way:
Definition 2: Let $\cal J$ be a (small) category category. A diagram in $\cal C$ is a functor $F:\mathcal{J}\to \mathcal{C}$.
Definition 1 just seems like a "dumbed down" version of definition 2, and maybe the author chose this definition because at this point in the book he didn't even introduce functors.
My question is whether these definitions are equivalent. For example, $F$ being a functor implies that for any $a\in \cal J$ we have $F(id_a)=id_{F(a)}$, so we are considering that in our diagram we have identity morphism associated with every object, and this is not the case using definition 1 of a diagram.
As far as I know, the existence of identity morphisms in the diagram makes no difference when defining the limit and colimit of the diagram, however, there might be definitions in the future that use diagrams as a building block and require them to have identities.
I am asking this question because definition 1 is way more intuitive and easier to visualize, at least for me, and not only that, but it makes understanding cones and limits of diagrams way easier because it simplifies a lot the notation. However, if definition 2 is more useful and standard in the long run I'd rather know that now so I can start using it and building some intuition around it as soon as possible.
Definition 1 is more talking about way we would draw a diagram, as a literal picture. For example, consider the "diagram" below $\require{AMScd}$ \begin{CD} B @>{g}>> D\\ @A{f}AA @AA{k}A \\ A @>>{h}> C \end{CD} We left out the arrows $gf$ and $kh$ in the drawing, which should be there according to definition 2. But fine, maybe that will just be a convention of drawing pictures: don't include superfluous information (like identity arrows).
There is another important difference though, consider the simpler triangle diagram consisting of $A \xrightarrow{f} B \xrightarrow{g} C$ and $A \xrightarrow{h} C$ (you'll have to draw the picture yourself now, I do not know how to draw a triangle in MathJax). In definition $2$ there might be the implied condition that $h = gf$, if the category $\mathcal{J}$ is the triangle (due to functoriality of $F$). Note that this may not always be the case, for example we could get the same picture if $\mathcal{J}$ is the category with 3 separate arrows: $X \to X'$, $Y \to Y'$ and $Z \to Z'$. In this case there is no requirement for things to commute. In fact, the latter shows that diagrams in the sense of definition 1 are always diagrams in the sense of definition 2: just consider the category $\mathcal{J}$ with an appropriate number of separate arrows.
In other words: definition 2 can impose conditions on parts of the diagram that need to commute, and definition does not allow for this.
In relation to limits and colimits: when taking the (co)limit of a diagram we do want condition 2. Mainly because it allows us to be more precise about the kind of (co)limits that we want to consider, by talking about a more exact "shape" of their diagram. See also user43208's answer for more details on this.