Note that there are some explanatory texts on larger screens.

plurals
  1. PONHibernate mapping message logic
    primarykey
    data
    text
    <p>I made some classes that represents my messages logic:</p> <ul> <li>Message - representation of THE message :)</li> <li><p>MessageBoxBase - base class for all 3 kind of messagebox</p></li> <li><p>MessageInbox - representing inbox</p></li> <li>MessageOutbox - representing outbox</li> <li>MessageCustombox - user defined message box</li> <li>MessageBoxItem - message item in any messagebox with such data as IsReaded etc.</li> <li>MessageBoxCollection - Collection of messageboxes - Inbox, Outbox and List of CustomBoxes - only that 3 properties.</li> </ul> <p>Finally in my agregate root User have MessageboxCollection, and I can use it somewhat like that:</p> <pre><code>myUser.MessageBoxes.Inbox.Add(...) myUser.MessageBoxes.Outbox.Items.... </code></pre> <p><img src="https://i.stack.imgur.com/fLMEi.png" alt="Diagram of that classes"></p> <p>I dont have any DB structure right now and I'm open on sugestion, but I was thinking about something like that:</p> <ul> <li>MessageInInbox - UserId,MessageId, IsReaded etc.</li> <li>MessageInOutBox - Same as in Inbox</li> <li>MessageInCustomBox - UserId,MessageId, CustomBoxId and so on</li> <li>CustomBox - BoxId, UserId, BoxName etc.</li> <li>Message - plain message row, subject, content, author etc.</li> </ul> <p>One I'm sure is that I don't want to create in DB row for each Inbox/Outbox for each user like it is in CustomBox case (something like unnecessary dictionary for inboxes and outboxes per user).</p> <p>And in that point I have a problem - <strong>how the hell to map that</strong> ? :)</p> <p>Have any suggestions? Maybe my domain is crappy? I'm waiting for yours response :)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload