# When to use Struct?

**URL:** <https://forum.elixirforum.com/t/when-to-use-struct/2396>\
**Category:** Questions\
**Tags:** data-structures, book-programming-elixir, structs\
**Created:** [November 15, 2016, 1:46pm UTC](https://forum.elixirforum.com/t/when-to-use-struct/2396 "2016-11-15T13:46:20Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![arashm](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/arashm/32/2194_2.png) [@arashm](https://forum.elixirforum.com/u/arashm)\
**Post date:** [November 15, 2016, 5:06pm UTC](https://forum.elixirforum.com/t/when-to-use-struct/2396/5 "2016-11-15T17:06:20Z")

</div>

> [@peerreynders](#):
>
> Also does “name” and “title” actually return data that is identical or do they merely return data that has the same shape

It returns identical data. Imagine an API endpoint for searching products, and one for getting info about an specific product. The former returns an array of products and latter returns one product. One of them has `name` attribute and the other `title` but with same value and purpose.

---

_[View the full topic](https://forum.elixirforum.com/t/when-to-use-struct/2396)._
