|
Have you had a direct experience with a MS dll infected with any form of malware that is triggered only when a specific facility in the dll is invoked ?
«The mind is not a vessel to be filled but a fire to be kindled» Plutarch
|
|
|
|
|
I am working on an existing C# application, and find that there is a set of class definitions like this:
public class Class1<Ttype> { }
public abstract class Class2 { }
public class Concrete2 : Class2 { }
public class Report { }
public class Class3 : Concrete2
{
public Class1<Report> report = new ();
}
Would you call this spaghetti code? Or, is this a standard Design Pattern? Currently, it is causing my mind to whirl.
modified 9-Dec-21 0:29am.
|
|
|
|
|
Hmmm,
Kinda looks like a abstract factory pattern.
|
|
|
|
|
Thanks. Will go through this Abstract Factory pattern.
|
|
|
|
|
Greetings Kind Regards May I please inquire as to why your name is red colored Thank You - Cheerio
|
|
|
|
|
Hmmm,
Let's make a deal. If you tell me why you don't use any punctuation in your writings then I will tell you why my name is Red .
Deal?
|
|
|
|
|
Okee-Dokee I know a fellow much smarter than myself He suggested it He annoys me greatly if I don't take his advice This one I more or less am inclined to as he convinced me that punctuation marks seem as maculation on the page though I have a certain fondness for a well placed comma but periods I can live without His stated argument was when people speak they do not speak "comma" or "period" as would otherwise be placed in text Of course pauses and intonation do the job as he well knows but so far so good more or less Though I may return to my previous usual usage of ,'s, .'s and ?'s etc. - Cheerio
|
|
|
|
|
What makes you think this fellow is much smarter than yourself?
|
|
|
|
|
As for your inquiry for one thing he explained to me what a fractional root means and why Something I wondered about prior For another he explained how my childhood theory of gravity which by the way I knew was incorrect at the time should have led me to the idea of virtual particles Also from time to time he suggests solutions to minor occasional every-day problems which do not occur to me I hate his guts - Cheerio
|
|
|
|
|
PaltryProgrammer wrote: when people speak they do not speak "comma" or "period" as would otherwise be placed in text
It just occurred to me that you may have a disability that requires speech-to-text. I apologize for asking, I should have thought about this.
I've been here on codeproject for nearly 20 years. Many years ago Chris added support for colorized usernames, around 15 years ago the forums were full of users with colored names, it seems I am one of the last users left that use this feature. The color has no meaning.
Best Wishes,
-David Delaune
|
|
|
|
|
Rest assured no need to be concerned I have no such disability My only disability is the love of pizza fresh vegetables in exotic hot sauces McDonald's Egg McMuffins freshly baked bread whole wheat of course and popcorn to name but a few Somehow I manage to stay slim and trim I probably would have chosen green to wit British Racing Green or perhaps red i.e. Alpha Romeo Red - Cheerio
|
|
|
|
|
Hi Bernard,
All this time I thought you were just trolling the site, but using the tools at my disposal I was able to find your identity. Your prose is natural, you weren't lying.
Welcome to codeproject, don't worry, I won't DOX you. 
|
|
|
|
|
|
People do, in fact, speak with commas, periods, hyphens, etc. They are implemented in the length of time between words and voice inflections. Punctuation reflects how the words should be spoken as an intelligible phrase. Not using punctuation (when one can, of course) is just poor writing or laziness.
As for the OP question "Is this spaghetti?", it depends on the context of the project as a whole. I lean towards the old saying, "The more they overtake the plumbing, the easier it is to stop up the drain." Or a similar old saying, "Make it as simple as possible, but no simpler." The context of the project as a whole may dictate the inheritance complexity you see, or it could just be some developer who understands how to implement some arcane design pattern, but not why or when it is apporpriate.
|
|
|
|
|
Namaskara,
I'd call it "sloppy pasta" without mnemonic flavors of some strange twisty type, but, definitely not idiyappam imho, the best way to evaluate/study it is to ... if you are convinced it is safe, and, it does something interesting ... set break-points and single-step through some code that instantiates the classes.
cheers, Bill
«The mind is not a vessel to be filled but a fire to be kindled» Plutarch
|
|
|
|
|
Namaskara,
That's what I am doing, putting breakpoints, and going through it step by step.
Thanks
|
|
|
|
|
The sauce however lacks body and flavour.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
this just look like a bunch of class in the same file. there is hardly enough to call that anything...
for example
public class List<T> {}
public abstract Visual {}
public class UIElement : Visual {}
public class String {}
public class FrameworkElement : UIElement
{
public List<string> strings = new ();
}
Unless you mean to suggest? perhaps split that in a few files?
that not spaghetti, but that would be a little more organisation!
spaghetti code is about code lacking.... hierarchical stucture, well defined responsibility, that sort of thing.
Not so much about whether the code is one humongous file or many small ones.
modified 9-Dec-21 1:59am.
|
|
|
|
|
This makes sense. I am starting to understand the code.
|
|
|
|
|
It would depend on what the classes contained: it's quite possible for that to be a good design - and the Concrete2 class could be just trying to get round a bug in teh VS designer that has been unfixed since the first release of .NET: you can't use the designer on a Control derived from an abstract class without a dummy concrete class between them:
public abstract class MyBase: UserControl { ... }
public class _MyBase: MyBase {}
public class MyControl : _MyBase { ... } The designer can open MyBase and MyControl , but can't open _MyBase
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Thanks for your reply. I am starting to understand the code, and it seems to be too intelligent a design for a lay person like me.
|
|
|
|
|
If you have to ask, then the answer is probably YES.
|
|
|
|
|
Looks like the natural progression of a first time C# project.
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
|
|
|
|
|
No. Spaghetti tastes good.
Nothing succeeds like a budgie without teeth.
|
|
|
|
|
I don't know what this is, but it's not spaghetti code.
Spaghetti code is when you break the sequential flow of your code by jumping to somewhere else, without the possibility to come back.
One would think it is not used anymore these days, but that is not really true. Every time you write a return in the middle of a method you actually break the sequential flow, which is technically speaking spaghetti code. Granted this has not the disastrous consequences as the old goto, but still...
|
|
|
|