It really depends on the purpose of the yard.
There are division yards that handle resorting shipments for local traffic from and to through trains.
MoW yards.
Small yards for big businesses.
A small railroad would have a smaller yard and sometimes do several things in that one yard (sorting, storing, maintenance, etc.) as opposed to a larger railroad that has different yards for each item.
Locomotive service yards.
Freight/passenger car service yards.
Defining the purpose of the yard beforehand determines things like size, track assignments and layout, buildings needed, etc.