|
CalinNegru wrote: Looking at a large project
Depends on what "large" actually means...
In the real world companies end up with software that was created by many people over time.
As with everything else that humans are involved in quality tends towards the average. That includes design which impacts what you refer to as 'structure'.
Programmers also like to think that they know for certain that the best way to do something is the way they know. Which is completely subjective.
So they create new 'better' solutions willy-nilly and hack them into existing code bases because of that. Then they leave the company and someone else starts doing it. Overtime this leads to significant organizational problems.
Even in the best systems there are real world business requirements that only come up long after the original design and for which the original design did not account. And the company is not willing to pay to refactor the entire code base when this happens. Even worse if it wasn't well designed. Or with 'better' ways on top of it.
And developers seldom consider the long term impact on maintenance when they make radical decisions to go in a different direction on a code base. It is known (multiple studies) that maintenance costs are always 2 to 10 times higher than the original cost to develop the product. And 100 times higher is probably reasonable for some.
Might note that although I point out developers in the above I have never seen a company that was actually willing to recognize the maintenance costs much less put an emphasis on mitigating for that.
|
|
|
|
|
Background
I have a WPF app in which I'm using DevExpress Reporting.
To create a report based off a List<t> there is a wizard which allows you to choose "Object Data Source". When you choose that you see a list of entities in your app that are marked with the attribute "[HighlightedClass]". This attribute is defined in the namespace "DevExpress.DataAccess.ObjectBinding".
My WPF UI, DAL, BL, and entities are all defined in seperate projects. This all works fine.
Problem
Now I'm working on a Xamarin Forms project that will use the same DAL, BL, and entities to pull data from the WPF project into an Android app.
My shared mobile project has references to the DAL, BL, and entities. And this is where the problem is... when I deploy to the Android I get deployment errors saying that the Android project can't resolve references to DevExpress assemblies.
I'm sure that if I were to remove the "[HighlightedClass]" attribute from the Entities project then everyting would deploy fine. But then I would not be able to create new reports in the WPF project.
Possible Solution
One idea I have is to create local models in the WPF project for reporting. My UI project could call back into the back end, get back a list of data as LIST<t>, them map them to local models which would use the attribute. This way the attribute only appears in the WPF project where the reporting happens. The Entities project would no longer know about DevExpress. And the Android app would no longer complain about it.
But this is a lot of work and could create maintenance headaches as I would have local Models that are exact duplicates of the Entity classes in the Entites project. I would have to make changes in two places.
I'm open to suggestion here.
Thanks
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
Have you considered creating your own [HighlightedClass] stub attribute in the correct namespace that could be used as a stand-in reference in the other project?
It would just need to be compile compatible with the real class.
Or possibly even it is compiled as a source only attribute in one context…
This leads to a scenario where you might want the same source to be shared across two different projects so it can be compiled two different ways?
Or use it as a binary dependency? You have 2 versions of a DLL?
|
|
|
|
|
Like a Halo ring, or a Dyson Sphere? Just want your thoughts on megastructures.
And if you are not a Halo fan, go by Larry Niven's Ringworld.
|
|
|
|
|
Tagged you as a troll for posting OBVIOUS off-topic, bullshit questions in the programming forums.
modified 29-Dec-21 9:49am.
|
|
|
|
|
To be fair if they are new to technology/programming they might not know what "Design and Architecture" means.
|
|
|
|
|
To be fair, you just have to look at all the other posts to figure out this isn't the forum for Halo and megastructures.
|
|
|
|
|
Experienced people might be expected to look at that. I would not expect someone with no experience to know to do that. Same as I would not be able to expect them to craft specific enough google queries to return relevant results to many programming problems.
|
|
|
|
|
Really? It's in the name of the site!
|
|
|
|
|
Circular? As I said in the first post....
"they might not know what "Design and Architecture" means."
Architecture for someone new to programming would mean 'the art or practice of designing and constructing buildings.'
So yes in that context this would be exactly the forum to ask that question.
|
|
|
|
|
jschell wrote: So yes in that context this would be exactly the forum to ask that question.
Well, yeah, IF you completely ignore the larger context of "Code Project".
|
|
|
|
|
Also already stated in my original post....
"To be fair if they are new to technology/programming"
|
|
|
|
|
I know what design is, but not software architecture. My bad, won't happen again.
|
|
|
|
|
And it's he. not they or it. I understand you can't assume, so I am clarifying.
|
|
|
|
|
American English speakers (not sure if Great Britain English speakers do this so I'm being specific) will often use they, their, them for a single person being referenced as was being done in the post you commented on. I am fairly sure that is what happened in that post rather than that person assigning a pronoun to you(2nd person pronoun).
I’ve given up trying to be calm. However, I am open to feeling slightly less agitated.
|
|
|
|
|
If you thought it was a troll, then he might be working you from two or more accounts. 😂
Troll!
Re
Re
Re
Re
|
|
|
|
|
You can post this to the Lounge forum.
The answer is no. Technology and science is based on a progression from past achievements. And it is also impacted by economics. You can read up on the practical problems associated with building some of the tallest buildings in the world right now. That would include things like the base of the building, how they deal with sway and some of the tricks that they use to get to be the "tallest" without actually paying to build something useable to that height.
|
|
|
|
|
I`m not sure which branch this subject belongs to, D&A seems `general` enough so I`m attaching my question here. The question is is there a difference between the algorithms that operate with bits and those created for a quantum computer?
|
|
|
|
|
You can't approach Quantum Computing procedurally. (Sort of like one big simultaneous equation with all possible solutions until it's collapsed into one ... "optimum" solution).
Quantum Computing Vs. Classical Computing In One Graphic - CB Insights Research
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
|
|
|
|
|
Thanks for feedback Gerry
|
|
|
|
|
The quantum computer mechanics work on the qubit which is a two-state quantum-mechanical system that is one of the simplest quantum systems and the bit refers to the binary digit system which is basically a unit of the amount of information in computer.
|
|
|
|
|
I have a WPF app that is part of a basic n-tier design. UI <=> BL <=> DAL. It's been under construction for a while and we just keep adding features to it.
At some point in the future, 6 months or so, the BL and DAL will be hosted in a Web API in IIS on the client's server.
Right now, parts of the UI are VERY slow. There is a Project view with a detail section on top and sub tabs below. All of the data is being brought back as soon as the project is opened, and it takes a long time.
I want to do some refactoring, such as:
- Lazy load the sub tabs. However, some tabs cannot be loaded unless data from other tabs is there. Other tabs are stand-alone.
- Everything is synchronous. Make back end calls async.
- If a tab's data is changed, for the most part the other tabs don't know about it. A few raise a changed event, but for the most part, the Project needs to be reloaded. Changes from other users are not reflected at all until the Project is reloaded. So I could keey the local data synchronized, but for data from other users, provide change notification somehow.
These are the top 3 issues. The big one is the load/save time.
For the Project opening load time and save time issue, one idea I've had is to create a 'package', which would just be a class with only the data that is needed to load the Project, and asynchronously call that when the tab is opened. Then, lazy load tabs as needed. They also would use the package concept to get only the data needed to populate that tab, which could be one or more lists of entities.
On save, load & send the Package class with only the data that has changed back to the DAL.
I'd like to hear what you guys think.
Thanks
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
I don’t know if this will work or not but it might change the way you think about it.
BL can be as fat (memory wise) as you want.
Think of each tab or just implement each tab as a separate page where it’s tab is highlighted/active and all of the other tabs are listed but have 0 data or even elements loaded.
The tab label is disabled if it is not possible to load it yet.
Why load stuff or try to keep it up to date if it is not visible? With 12 tabs, you could have 12*11 update patterns to keep track of.
The only concern becomes if an action on a tab updates a shared header area.
|
|
|
|
|
I have an application that reads a directory's files, displays them in a grid, and offers a toolbar with buttons that invoke functions that apply to all the files in the grid.
In the following code, reduced to its essentials, when the user clicks the Trim button in the toolbar, toolTrim_Click executes, opening the form that collects the options for the Trim operation, and then invoking the method that trims the pages from the list of files. That method then invokes for each file the method that trims the pages from that particular file. The async part is just to keep the window draggable.
private async void toolTrim_Click(object sender, EventArgs e)
{
var form = new TrimOptions();
DialogResult result = form.ShowDialog();
if (result == DialogResult.OK)
{
await Task.Run(() => filesList.TrimPages(form.trimFirst, form.trimLast, form.ifBlank));
}
form.Dispose();
}
public void TrimPages(bool trimFirst, bool trimLast, bool ifBlank)
{
for (int entry = 0; entry < TotalPDFs; entry++)
{
FileEntry thisFile = list[entry];
thisFile.Trim(trimFirst, trimLast, ifBlank);
}
}
public void Trim(bool front, bool back, bool ifBlank)
{
} What would be the pros and cons of refactoring the above code like this? The difference is that we move opening the options form to the class that manages the list of files instead of keeping it in the main form class.
private async void toolTrim_Click(object sender, EventArgs e)
{
await Task.Run(() => filesList.TrimPages());
}
public void TrimPages(bool trimFirst, bool trimLast, bool ifBlank)
{
var form = new TrimOptions();
DialogResult result = form.ShowDialog();
if (result == DialogResult.OK)
{
for (int entry = 0; entry < TotalPDFs; entry++)
{
PDFEntry thisFile = list[entry];
}
}
}
public void Trim(bool front, bool back, bool ifBlank)
{
} It seems to me that the class that manages the list of files should be the class that collects the various operation options, but I don't know which is the best practice, or what the implications are of doing it the second way.
modified 2-Jan-22 19:11pm.
|
|
|
|
|
I see no reason to use a modal dialog. You could use a regular form and encapsulate ALL the related logic in the form.
Alternatively, create a static class with a single entry point that wraps the logic and dialog.
Component-based design.
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|