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 194399
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T16:35:31+00:00 2026-05-11T16:35:31+00:00

My c++ SOA app has a concept of session that is used exchange data

  • 0

My c++ SOA app has a concept of “session” that is used exchange data between services. In example its used for checking legality of some service A operations before executing session B which commits or rollback changes. Whatever.

I have 2 types of session modes: normal and what-if. Going further, I have different session, session for legality, session for assign, session for commit etc. This is a main problem. Legality session can be what-if or real etc.

How to fix that and avoid code duplication?

I can make a ISessionFactory interface and have WhatIfFactory and RealFactory implement it. Then I could make a ILegalitySession and make WhatIfLegalitySession and RealLegalitySession implement it. Then my factories would return appropriate objects.

It has 2 major problems. What if new mode will come? I will have to implement new factory and new classes for all sessions! What if new session type comes? I have to change both of factories…

Perhaps resign from 2 hierarhies and have whatIf sessions “decorate” real session?
How can I localize the change?

  • 1 1 Answer
  • 0 Views
  • 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. Editorial Team
    Editorial Team
    2026-05-11T16:35:31+00:00Added an answer on May 11, 2026 at 4:35 pm

    Try to implement your WhatIf with decorators. Or extract some ‘what if’ specific parts to kind of strategy.

    Another option is using of the State pattern. ‘WhatIf’ state and ‘Real’ state.

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

Sidebar

Related Questions

I have an app that uses a couple of SOA calls to get some
One of the tenets of SOA is: Services Are Autonomous. I have 2 services.
You are doing contract first development of web services in a SOA world. After
Among the data my application sends to a third-party SOA server are complex XMLs.
The concept I have uses a central MySql database which has many Java clients
I have a rails app that tracks membership cardholders, and needs to report on
I'm creating a web app that requires registration/authentication, and I'm considering using an email
My problem is that I have a site which has requires a dedicated page
We have a very large GWT project that results in a monolithic app about
In our SOA application we have several customers' data in the same database and

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.