BdLm
asked on
3 level software architecture
what is the best way to move progress information from a 3rd. level routine to the GU level ???
procedure button1.click (......)
begin
MyClass.DoSomeAction (...; aGuiProgressBar; ......);
end;
procedure TMyClass.DoSomeAction (........aGuiProgressBar : TProgressbar...);
begin
ExecuteComplexCalc( ...aGuiProgressBar .... ...);
end;
procedure ExecuteComplexCalc (........ .aGuiProgressBar : TProgressbar ..................... )
begin
aGuiProgressBar.value := i; // set the value here
end;
procedure button1.click (......)
begin
MyClass.DoSomeAction (...; aGuiProgressBar; ......);
end;
procedure TMyClass.DoSomeAction (........aGuiProgressBar : TProgressbar...);
begin
ExecuteComplexCalc( ...aGuiProgressBar .... ...);
end;
procedure ExecuteComplexCalc (........ .aGuiProgressBar : TProgressbar ..................... )
begin
aGuiProgressBar.value := i; // set the value here
end;
ASKER
you refer to https://www.experts-exchange.com/Programming/Languages/Pascal/Delphi/A_239-Displaying-progress-in-the-main-form-from-a-thread-in-Delphi.html ??
from design style level 3 should only talk to level 2 but never to level 1, but this is much more coding instead of the dirty way .....
I need the reuse design as I use the level 3 libraries for many different projects
from design style level 3 should only talk to level 2 but never to level 1, but this is much more coding instead of the dirty way .....
I need the reuse design as I use the level 3 libraries for many different projects
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I agree with the separation,
but in this case consider the observer pattern
even for multiple levels
i'll show a sample in a minute with different levels and the observer pattern
but in this case consider the observer pattern
even for multiple levels
i'll show a sample in a minute with different levels and the observer pattern
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
what about for level 3 :
function heavyCalcLevel3(.......; aFeedBackElement : TObject);
begin
if ( aFeedBackElement is TProgresslbar then
begin
......
end;
end;
Thanks for your discussion
function heavyCalcLevel3(.......; aFeedBackElement : TObject);
begin
if ( aFeedBackElement is TProgresslbar then
begin
......
end;
end;
Thanks for your discussion
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
BdLm, Thanks for giving me some points, Geert has done a great job helping you with this topic where I only added stone to the building. I was ready to accept I would get no credit.
BUT :
When you select multiple answers, please do not select everything without consideration of the value of the answers. And you can change the amount of points each answers is worth, not just let the automatic division calculate it for you. With your way, it gives the impression that it is only needed to post a maximum of comments whatever the quality, and if more than one is selected then you will have better reward than a single complete explanation.
for example, you selected ewangoya #33460548 and geert response about it. They bring no value to the discussion.
Next time, select only the real answers to the question and change the value of the ones that helped you most (geert last post in this case is the main one and is worth by itself 300-400 pts). This will also ensure that the 'ACCEPTED SOLUTION' is the one with most points, so the one that really deserves it.
BUT :
When you select multiple answers, please do not select everything without consideration of the value of the answers. And you can change the amount of points each answers is worth, not just let the automatic division calculate it for you. With your way, it gives the impression that it is only needed to post a maximum of comments whatever the quality, and if more than one is selected then you will have better reward than a single complete explanation.
for example, you selected ewangoya #33460548 and geert response about it. They bring no value to the discussion.
Next time, select only the real answers to the question and change the value of the ones that helped you most (geert last post in this case is the main one and is worth by itself 300-400 pts). This will also ensure that the 'ACCEPTED SOLUTION' is the one with most points, so the one that really deserves it.
ASKER
Thanks for the inputs, my intension was to honor the complete discusssion, even geert again made a great job with very useful inputs for me. Should increase to points to 1000 :-)
btw:
is there any language forcing people to develop software in 3 levels of architecture ? getting contributions to my software project from different people I get crazy if the violate the 3 level design style ....
btw:
is there any language forcing people to develop software in 3 levels of architecture ? getting contributions to my software project from different people I get crazy if the violate the 3 level design style ....
probably not the best, but it shows independance of a class towards a form using a callback procedure
a lot of solutions i see, have the name of the form or the progress inside the thread
which is useless if using the same unit in a other unit/form with a different name