If you're still in school, pay attention to this....you will have to deal with it someday
-
I am in a sticky situation at work...quite a bit of explanation to get to the root of this problem....I have to make changes to a system that I have never touched and this system is the epitome of bad bad BAD BAD BAD....if I COULD, I would publish this thing so that an anti-pattern could be developed from it. ...To give you just some taste of what I have to deal with, the Layered Architectural Pattern was improperly applied by the architect. Rather than having a UI Project with references to a separate Data Services library and a Business Logic Library, there is a FOLDER....(Yes..that's what I really said)...a FOLDER inside a single project named "DAL" and a FOLDER named "BL" and a FOLDER named "UI" and developers(frikkin contractors) that have worked on this system in the past have cross-switched the heck out of this thing because they didn't know any better and the architecture allowed it ...To give you some further insight into what I have to deal with, the standard method of exception handling in this system is not by a try/throw/catch mechanism, but by passing a reference to an Exception Handle through the method signature and assigning it in the catch block. ...Yeah, it's THAT crappy. (And if you're scratching your head about the ref to the Exception Handle, that's because....surprise, surprise.....this system is written...err...scripted in VB.NET)*see note at end of post to see why I posted in the C# forum* ...Anyway, I'm trying my best to work my changes(System Access Maintenance screen....simple crud aspx page) into their existing architecture because I want to get in, get done, and get the hell out of Dodge. ...Don't even ask to see this object model...you don't want to see it....but basically, there's de-normalized data maintained on an Employee table for status(Arbitrary values of "A" for active and "I" for inactive) with no reference table to fetch from. ...There's also a "Role" and "Position" attached to each user(puzzlingly, there ARE reference tables for those values)...Role and Position are maintained as a hash of code/value pairs (i.e. "ADM"/"Administrator") ...and the form I am to create is to display "Administrator" while maintaining "ADM" as the actual value to be assigned to a new system user when performing an Upsert...simple, common problem,right? ...ok, so my solution was to do this:
"I need build Skynet. Plz send code"
-
I am in a sticky situation at work...quite a bit of explanation to get to the root of this problem....I have to make changes to a system that I have never touched and this system is the epitome of bad bad BAD BAD BAD....if I COULD, I would publish this thing so that an anti-pattern could be developed from it. ...To give you just some taste of what I have to deal with, the Layered Architectural Pattern was improperly applied by the architect. Rather than having a UI Project with references to a separate Data Services library and a Business Logic Library, there is a FOLDER....(Yes..that's what I really said)...a FOLDER inside a single project named "DAL" and a FOLDER named "BL" and a FOLDER named "UI" and developers(frikkin contractors) that have worked on this system in the past have cross-switched the heck out of this thing because they didn't know any better and the architecture allowed it ...To give you some further insight into what I have to deal with, the standard method of exception handling in this system is not by a try/throw/catch mechanism, but by passing a reference to an Exception Handle through the method signature and assigning it in the catch block. ...Yeah, it's THAT crappy. (And if you're scratching your head about the ref to the Exception Handle, that's because....surprise, surprise.....this system is written...err...scripted in VB.NET)*see note at end of post to see why I posted in the C# forum* ...Anyway, I'm trying my best to work my changes(System Access Maintenance screen....simple crud aspx page) into their existing architecture because I want to get in, get done, and get the hell out of Dodge. ...Don't even ask to see this object model...you don't want to see it....but basically, there's de-normalized data maintained on an Employee table for status(Arbitrary values of "A" for active and "I" for inactive) with no reference table to fetch from. ...There's also a "Role" and "Position" attached to each user(puzzlingly, there ARE reference tables for those values)...Role and Position are maintained as a hash of code/value pairs (i.e. "ADM"/"Administrator") ...and the form I am to create is to display "Administrator" while maintaining "ADM" as the actual value to be assigned to a new system user when performing an Upsert...simple, common problem,right? ...ok, so my solution was to do this:
"I need build Skynet. Plz send code"
I created a structure that has 2 string properties, Code & Text. I created the stored procedure that queried the database for the set of Role Code/Description combos(passed in a parameterized sys_refcursor) ...execute the reader, storing each of the column values in an appropriate variable of my Structs type, add it to the ArrayList and loop. Ok.....so here's where I get to the point of "working with their existing system." ...I don't pass up through any business logic layer to get to the UI here, because this path doesn't need to be maintained back to the data. I bound the DropDownList on my form directly to the result set of my "GetRoles" method. ...During the code review with Support, they don't understand why I created the struct. ...They think that I should have (and are trying to force me into) simply bound the OracleDataReader directly to the UI!!! I tried explaining to them that you're not supposed to expose data access objects(as in DataSet, DataTable, DataAdapters) directly to the client like that and that what I had done was essentially the same thing, but I cannot think of any point of defense for my technique besides "I said so" and "because the way you want it to be done is Spaghetti Code" ....their solution is TECHNICALLY correct, but it is really coming down to their personal preference and getting into a "Well, I would have done it this way" .....I don't have the time(calendar) or time(budget hours) to make this change, but they have to sign off on this before it's out of my hands. ...Does anyone have any suggestions that I might be able to use for my defense? I was going to hang my hat on the fact that I am creating a structure, and therefore it doesn't need to invoke the GC, but I go ahead and put them in a darn ArrayList. ...I'm probably just going to create a static array of my structure so that I can lean on that point, but I want to do my best to make sure that they can't convince my manager to have me change this just "because they said so"
"I need build Skynet. Plz send code"
-
I created a structure that has 2 string properties, Code & Text. I created the stored procedure that queried the database for the set of Role Code/Description combos(passed in a parameterized sys_refcursor) ...execute the reader, storing each of the column values in an appropriate variable of my Structs type, add it to the ArrayList and loop. Ok.....so here's where I get to the point of "working with their existing system." ...I don't pass up through any business logic layer to get to the UI here, because this path doesn't need to be maintained back to the data. I bound the DropDownList on my form directly to the result set of my "GetRoles" method. ...During the code review with Support, they don't understand why I created the struct. ...They think that I should have (and are trying to force me into) simply bound the OracleDataReader directly to the UI!!! I tried explaining to them that you're not supposed to expose data access objects(as in DataSet, DataTable, DataAdapters) directly to the client like that and that what I had done was essentially the same thing, but I cannot think of any point of defense for my technique besides "I said so" and "because the way you want it to be done is Spaghetti Code" ....their solution is TECHNICALLY correct, but it is really coming down to their personal preference and getting into a "Well, I would have done it this way" .....I don't have the time(calendar) or time(budget hours) to make this change, but they have to sign off on this before it's out of my hands. ...Does anyone have any suggestions that I might be able to use for my defense? I was going to hang my hat on the fact that I am creating a structure, and therefore it doesn't need to invoke the GC, but I go ahead and put them in a darn ArrayList. ...I'm probably just going to create a static array of my structure so that I can lean on that point, but I want to do my best to make sure that they can't convince my manager to have me change this just "because they said so"
"I need build Skynet. Plz send code"
-
...I posted in here because I don't trust VB scripters. I'm sure they would look at it and say "what are you talking about...you're SUPPOSED to just bind the DataSet to the UI control"
"I need build Skynet. Plz send code"
...not to say that knowing VB is a bad thing(heck, I know VB ;) ) ...but still, if you're familiar with the history of Basic, then you know why I don't trust VB programmers....the language is a travesty and should be stricken from any and all annals of recorded human history....but that's just my opinion lol
"I need build Skynet. Plz send code"
-
I created a structure that has 2 string properties, Code & Text. I created the stored procedure that queried the database for the set of Role Code/Description combos(passed in a parameterized sys_refcursor) ...execute the reader, storing each of the column values in an appropriate variable of my Structs type, add it to the ArrayList and loop. Ok.....so here's where I get to the point of "working with their existing system." ...I don't pass up through any business logic layer to get to the UI here, because this path doesn't need to be maintained back to the data. I bound the DropDownList on my form directly to the result set of my "GetRoles" method. ...During the code review with Support, they don't understand why I created the struct. ...They think that I should have (and are trying to force me into) simply bound the OracleDataReader directly to the UI!!! I tried explaining to them that you're not supposed to expose data access objects(as in DataSet, DataTable, DataAdapters) directly to the client like that and that what I had done was essentially the same thing, but I cannot think of any point of defense for my technique besides "I said so" and "because the way you want it to be done is Spaghetti Code" ....their solution is TECHNICALLY correct, but it is really coming down to their personal preference and getting into a "Well, I would have done it this way" .....I don't have the time(calendar) or time(budget hours) to make this change, but they have to sign off on this before it's out of my hands. ...Does anyone have any suggestions that I might be able to use for my defense? I was going to hang my hat on the fact that I am creating a structure, and therefore it doesn't need to invoke the GC, but I go ahead and put them in a darn ArrayList. ...I'm probably just going to create a static array of my structure so that I can lean on that point, but I want to do my best to make sure that they can't convince my manager to have me change this just "because they said so"
"I need build Skynet. Plz send code"
Well... You could try showing them how their method could be exploited by a malicious bit of software on a well-hacked client's machine... Basically, when all else fails, use security as your defense. Other than that, it is nearly impossible to convince somebody that their way sucks and that your way rules, especially if they have the power to approve or deny your changes. However, their boss's-boss's boss probably doesn't know jack about programming, and if you start talking "security breach" and "liability" they freak out and let you have your way. Been there, done that. It worked (wrote an ACH utility for in-house payroll to do direct deposit, back in '98, using VC++ 6.0 and ATL. Their old method was to use the bank's free ACH software, which required printing out of payroll data and manual entering... Every hacker in the world had already figured out how to crack into that software too...)