locked
How do you handle a family? RRS feed

  • Question

  • I am creating what is essentially a contact management app for my church. I want to be able to add people to people and create families?

    When I view the Person screen, I want to see a list of all the people that are associated to this person in a grid.

    Would this be the classic many to many where I create a "Family" table and then 2 one to many relationships to my person table?

    How would you model a family in a lightswitch app?

    Monday, November 25, 2013 3:41 AM

Answers

  • Hi Missiodei,

    To answer your first question 'How do you handle a family'.... my wife and I had a daughter 9 months ago. She's awesome. Apart from the lack of sleep, I think I'm handling it OK... and still getting a small amount of spare time to play with Lightswitch.

    To answer your other scenario:

    Yes, you certainly can create a family table, but I've found that it is more flexible to create a mechanism that allows any type of relationship between two contacts. 

    Take a look at this example: http://www.youtube.com/watch?v=hciBHWv1rgo

    This is done by having a Contacts table, and then a Relationships Table which has a 

    - Primary Contact

    - Related Contact 

    Then you need a RIA Service that effectively says: For this current contact, Show me all related contacts where I am the Primary, and then UNION this with all contacts where I am the related side.

    It's a bit of mucking around to get this right, but the end result is effective.



    • Edited by Matt Ireland AU Monday, November 25, 2013 5:56 AM
    • Proposed as answer by Eason_H Monday, December 2, 2013 9:32 AM
    • Marked as answer by Yunjie Pei - MSFT Tuesday, December 3, 2013 7:46 AM
    Monday, November 25, 2013 5:01 AM
  • Hi Missiodei,

    WCF RIA Services simplifies the development of n-tier solutions for Rich Internet Applications (RIA), such as Silverlight applications. A common problem when developing an n-tier RIA solution is coordinating application logic between the middle tier and the presentation tier. There is a good tutorial about WCF RIA Services from MSDN.

    If you want to know how to create WCF RIA Services for LightSwitch. You can refer to this article. http://msdn.microsoft.com/en-us/library/vstudio/gg589479.aspx

    If you have any further questions, please feel free to let us know.

    Thanks.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Proposed as answer by Eason_H Monday, December 2, 2013 9:32 AM
    • Marked as answer by Yunjie Pei - MSFT Tuesday, December 3, 2013 7:46 AM
    Tuesday, November 26, 2013 8:24 AM

All replies

  • Hi Missiodei,

    To answer your first question 'How do you handle a family'.... my wife and I had a daughter 9 months ago. She's awesome. Apart from the lack of sleep, I think I'm handling it OK... and still getting a small amount of spare time to play with Lightswitch.

    To answer your other scenario:

    Yes, you certainly can create a family table, but I've found that it is more flexible to create a mechanism that allows any type of relationship between two contacts. 

    Take a look at this example: http://www.youtube.com/watch?v=hciBHWv1rgo

    This is done by having a Contacts table, and then a Relationships Table which has a 

    - Primary Contact

    - Related Contact 

    Then you need a RIA Service that effectively says: For this current contact, Show me all related contacts where I am the Primary, and then UNION this with all contacts where I am the related side.

    It's a bit of mucking around to get this right, but the end result is effective.



    • Edited by Matt Ireland AU Monday, November 25, 2013 5:56 AM
    • Proposed as answer by Eason_H Monday, December 2, 2013 9:32 AM
    • Marked as answer by Yunjie Pei - MSFT Tuesday, December 3, 2013 7:46 AM
    Monday, November 25, 2013 5:01 AM
  • Thanks for the reply.

    I haven't really touched ria services at all. Have you come across a tutorial  that demonstrates how to set up the relationship with the ria service as you are describing above? It looks like that is exactly what I need.

    Monday, November 25, 2013 9:32 PM
  • Thanks for the reply.

    I haven't really touched ria services at all. Have you come across a tutorial  that demonstrates how to set up the relationship with the ria service as you are describing above? It looks like that is exactly what I need.

    This may help:

    WCF RIA Service (13)


    Unleash the Power - Get the LightSwitch HTML Client book

    http://LightSwitchHelpWebsite.com

    Tuesday, November 26, 2013 12:50 AM
  • Matt, Your solution sounds interesting.  Do you have any sample LINQ you can show?  I like the union idea very much.  Thanks.
    • Edited by Hessc Tuesday, November 26, 2013 3:01 AM
    Tuesday, November 26, 2013 3:00 AM
  • Hi Missiodei,

    WCF RIA Services simplifies the development of n-tier solutions for Rich Internet Applications (RIA), such as Silverlight applications. A common problem when developing an n-tier RIA solution is coordinating application logic between the middle tier and the presentation tier. There is a good tutorial about WCF RIA Services from MSDN.

    If you want to know how to create WCF RIA Services for LightSwitch. You can refer to this article. http://msdn.microsoft.com/en-us/library/vstudio/gg589479.aspx

    If you have any further questions, please feel free to let us know.

    Thanks.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Proposed as answer by Eason_H Monday, December 2, 2013 9:32 AM
    • Marked as answer by Yunjie Pei - MSFT Tuesday, December 3, 2013 7:46 AM
    Tuesday, November 26, 2013 8:24 AM