Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 122011
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T04:03:40+00:00 2026-05-11T04:03:40+00:00

How should I use the unit of work pattern in the following scenario: I’m

  • 0

How should I use the unit of work pattern in the following scenario:

I’m writing a winforms app. I have one screen where the user can edit a single order. On this screen, the user can open another form to select the delivery company. The user can also add/edit existing delivery companies in this child form before doing the selection.

How can I implement this scenario using the Unit of work pattern? Currently I have one unit of work for the order entry screen. My first thought was to include the child form in this unit of work too. The problem is, delivery company changes should be persisted when in the child form . But when I persist changes to the delivery companies, this will also persist the changes in the order.

Should I create a second unit of work for any edits to the delivery companies? In that case, how can I make the changes in that unit of work visible in the first unit of work?

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T04:03:41+00:00Added an answer on May 11, 2026 at 4:03 am

    From your description it sounds as if you really have two units of work here. The first is ‘Order Entry’ and the second one is ‘Edit Delivery Company’. Each unit of work has some underlying kind of session or transaction. To communicate from the child form to the order entry you’ll have to detach the company’s object from the child form’s session an re-attach it to the parent. How to actually implement this depends on the data access layer you’re using, but an easy way is to pass around the ID of the company.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use a unit of work pattern a lot in my flex projects. I'll
I don't know which title I should use for this question. I have a
Cheers!I have some doubts about using Unit of Work with Repository. Specially a role
I have read in Patterns of Enterprise Application Architecture that a Unit Of Work
Currently in my application and using the unit of work pattern and generic repository,
I'm currently researching how to add the Unit of Work pattern to my existing
I'm using NHibernate, DI/IoC and the Unit of Work pattern. Most UoW examples I've
i am using Entity Framework and repository with unit of work design pattern. Sometimes
I've read I should use money , but in todays fast paced world maybe
Why sometimes I should use block and other times &block inside functions that accept

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.