|
Rajeshjoseph wrote: In a scenario where a customer updates a field - say name - immediately two or more times, ....Any recommendations on the best way to implement such a functionality?
Best suggestion I know of - stop making up business cases.
When exactly, in the real world, is a user going to update their name twice from two different locations at the same time?
And if they do how are you going to determine which one is 'correct'?
Apply that same reasoning to any other concurrency issues that you might come up with.
Unless you can answer both questions definitively then the answer is last one wins. And it wins by default without you doing anything.
|
|
|
|
|
The architecture was proposed this way due to the following reasons:
1. There are multiple channels through which the core backend systems (system of records) will get updated - Web, Mobile App etc. To have these updated records always reflecting in the cloud, we are bringing the data from backend to cloud if a record gets updated. Web always reads the data from the cloud.
2. Since we are decoupling the core backend systems from the system of access for web, we are building a data repository in cloud for the web to access which will not have direct communication to the core backend systems (asynchronous in nature).
3. Since the backend updates will be asynchronous (it can vary from near to real-time to 1 hour depending upon various factors), it may not be fair to display the customer a message "you request will be processed later" when the customer updates his/her profile information or similar (no customer would love to see his name change to reflect after xx minutes). For this reason, the update will be directly saved to the DB in the cloud and will be read from the there by the web.
4. I was trying to work out a solution for a scenario where a customer updates his "First Name" twice in the interval of say 5 minutes - in this scenario - with the planned architecture - the second update will be displayed on the web as soon as it is done, while the first update will be in transit, making it's way to the core database asynchronously and as I mentioned in step 1, the core backend systems will send the record to the web again if they are updated (the update can happen from multiple channels) and will update the cloud DB which will re-write the second update for this record in cloud. After few minutes, the second record also will complete the round trip and will reach the cloud. But, during the time between the second update saved in the cloud, and completes the round trip - there is a possibility that the customer notices the first update getting displayed for few minutes.
Hope this explains!
|
|
|
|
|
You could try keeping time stamps with the updated values. when syncing from the core db to azure, you could check the time stamp and only update the field if the time stamp is greater.
|
|
|
|
|
Rajeshjoseph wrote: I was trying to work out a solution for a scenario where a customer updates his "First Name" twice in the interval of say 5 minutes - in this scenario - with the planned architecture - the second update will be displayed on the web as soon as it is done,
And how does that change what I said?
What is the exact business scenario where the user is ever going to update their name in 5 minutes?
And given that there is in fact exactly that scenario how are you going to use technology to determine that the 'second' one is right and the first one is wrong?
Let me show how contrived this is with the following business scenario
- You have a single user who is gender challenged.
- That person has two cell phones and they are on the train to work
- The two cell phones use two different service providers and one which is slower due to connectivity issues due to the provider.
- That person is using each cell phone to change their name from 'Dan' to 'Sara' on their way to work
Is the above an actual business scenario? Is the something that the company actually wants to spend real money on to support this extreme corner case? How is your software going to actually determine which button that user pushed last just before they got off the train?
|
|
|
|
|
Google for "Windows Kiosk Mode", and/or try to give more details on what you are trying to do. As is, your question is too vague.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Eddy Vluggen wrote: your question is too vague And already posted three or four times elsewhere.
|
|
|
|
|
Didn't view the message history, but good reminder why I should have
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
|
This isn't even a question. It's ironic that someone so lazy that cannot even type a question would post the same non-question multiple times.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Maybe it was an understated Eureka moment:
it window application form work in KIOSK (!!!)
(Yippee)
|
|
|
|
|
hi,
I'm reading about the flyweight design pattern. In my understanding it's basically something like 'use shared pointers/references to big objects in order to safe memory'.
Example: I'm writing a website, that contains 1MB pictures all over it. All the pictures are the same. Now, instead of transferring the picture x times, I. transfer it only once and let the website content always refer to that already transferred picture.
Am I right about that?
The often used example with the letters and glyph does really confuse me here, so I'd like to recheck.
I can't understand, why it would be better to have a referred letter instead of a simple char inside a class...
I really appreciate any help here!!
regards
modified 8-Feb-16 15:04pm.
|
|
|
|
|
You will need to be more specific about what you mean by "transferring".
Are you talking about content in a web page? FTP? What?
What / why 1 MB images? For display in a browser? Why not thumbnails?
|
|
|
|
|
Thank you for the answer!
yes, I was assuming a web page. But apparently the example was not appropriate and therefore missleading.
Maybe we should just skip the example.
So the "flyweight" in the "flyweight" pattern refers small objects, that all share some heavy ressource?
|
|
|
|
|
Yes; I would agree with your last statement.
"Small objects" that container references / pointers to "big" / data objects.
|
|
|
|
|
thank you
|
|
|
|
|
Hello All,
Could any one suggest how can I design the following the problem in C++?
How to provide access to a component of a Class to some third person. The constraints are
1. The third person should not be able to see the other details of the class!
2. the component should be accessible to only that particular third person!
I have a solution to the problem. But I would like to know other approaches to solve the issue.
Thanks in advance
~SSETH
|
|
|
|
|
sseth21k wrote: I have a solution to the problem. But I would like to know other approaches to solve the issue. You might want to explain your existing solution so that
a) people don't waste time on writing a suggestion for the same
b) people might give you tips how to improve it
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
class AccountInterface
{
public :
virtual void CheckAccount() = 0;
};
class Accountant
{
private:
AccountInterface * accountDept;
public:
Accountant():accountDept(NULL){}
void SetCompanyAccDept(AccountInterface *accDept){accountDept = accDept;}
void AuditCompany()
{
if (accountDept)
accountDept->CheckAccount();
else
printf("Compnay info not set");
}
};
class company : private AccountInterface
{
private:
virtual void CheckAccount()
{
printf("Only Granted Accountant should have access to this");
}
public:
void SetAccuntant(Accountant *accountant)
{
accountant->SetCompanyAccDept(this);
}
};
int main (int argc, char *argv[])
{
company c1;
Accountant ac1;
c1.SetAccuntant(&ac1);
ac1.AuditCompany();
}
I tried to demonstrate the idea with a company its account deptartment and an accountant.
Account Details should not be public. (no Public access)
The Accountant should not be able to access other details of the company ( No friend)
Company is responsible for granting access permission --Private Inheritance..( is a relationship with base class but no exposed to public)
Thanks,
SSETH
|
|
|
|
|
I'm not certain what problem you are trying to solve but that sounds far too complicated and unwieldy. The usual way to restrict things is by allocating permission levels to both users and data. That way you can grant or restrict access to individual people at run time.
|
|
|
|
|
Thanks for respond ..I dont know if you are really getting the what exactly I am trying to target in the code.. without friend and making public accessibility I want to restrict the permission to some particular user...
The way I am achieving is just one of the use case of Private Inheritance..
Could you please post here your approach(Design) in C++..
Thanks in advance..
|
|
|
|
|
SSETH wrote: Could you please post here your approach(Design) in C++.. I did in my previous message. The way you control access to different features is by taking decisions at run time, as to what facilities and data a particular user has access to. Doing it your way is nigh on impossible, and would need regular changes in the code.
|
|
|
|
|
First off of course this is a made up problem that should never be implemented specifically in code. Parts, depending on what you mean, might be implemented in they system but not code specifically (design versus code.)
But approaching it code wise.
sseth21k wrote: 1. The third person should not be able to see the other details of the class!
The implementation via class A. You have an API class that returns a proxy B. The caller uses B. B internally is implemented such that A supplies all the behavior.
Specifically in C++ this means that A will NOT be in an include file. Rather it should be a source file. In ractical wise you would probably put in its own package with its own include file
Code wise you could tighten this even further by delivering a binary rather than source code. Then all they could see would be the Proxy.
sseth21k wrote: the component should be accessible to only that particular third person!
There is a credential class. It has specific data that identifies the caller.
The API (above) is modified to take an instance of the credential class. The API checks the data to 'match' to the 'third person'. If it matches it returns the Proxy. If it doesn't match it returns null.
|
|
|
|
|
This is probably the first question I have asked on CP, so please be gentle , also my terminology might be a bit all over the place.
I admit I am pretty much a beginner as far as entity framework and architecture are concerned. I am in a bit of quagmire, I have inherited several applications that rely on one database and that database has one datacontext project which all these applications plug into.
Currently we are using TFS and each of these .Net applications have a project reference to this data context project, which is fine if you do not need to branch out and if it is a single programmer outfit.
Now I want to implement a better release strategy after a few D-Days and issues with half finished code (not caused by me). I want to go with the Gitflow strategy where I have three types of branches, a release (golden) branch, a trunk development branch and a day to day development branch. Now with several projects all tied together by a single datacontext project it is painful creating new branches, merging up, as it is huge and we lose track of changes. I agree there is very tight coupling and this needs to be reduced, I want to come up with a sane way of splitting the context and the applications into single entities. I agree what ever I do it will be time consuming but I would love a few opinions and experiences on people who have battled with this issue.
Thanks for reading,
|
|
|
|
|
A (current release) Entity Framework app is not limited to one "DbContext" per database (if that's what you're referring too).
The "entity class definitions" are what's "common" here; a given DbContext is simply a class that identifies the entities too be used in a given "context" (i.e. program / app).
I can have 3 tables: A, B and C.
One context can include tables A, B and C; another just B and C ... like a "view".
So; I don't see DbContext classes as limiting your ability to move forward.
|
|
|
|
|
Thanks for clearing that up for me, in that case I shall have multiple DbContexts referring to the same table but only sections I need for different applications. Thanks again,
|
|
|
|