Comment On Perseverance in the Face of Change Requests

A lot of “certain” developers just don’t like change. They’ll stick to their architecture no matter what, and certainly regardless of the requirements change. Doing any less would compromise the “purity” their design. [expand full text]
« PrevPage 1 | Page 2 | Page 3Next »

Re: Perseverance in the Face of Change Requests

2007-12-03 08:11 • by kramthegram (unregistered)
I guess that's where the phrase "From part's unkown." comes from.

Re: Perseverance in the Face of Change Requests

2007-12-03 08:16 • by ParkinT
"A part by any other name..."

Re: Perseverance in the Face of Change Requests

2007-12-03 08:35 • by Bartman (unregistered)
Parts is parts.

Re: Perseverance in the Face of Change Requests

2007-12-03 08:54 • by Strider (unregistered)
163789 in reply to 163786
Bartman:
Parts is parts.


Except for when Parts.isNotParts

Re: Perseverance in the Face of Change Requests

2007-12-03 08:58 • by Sjaak (unregistered)
DELETE FROM emps WHERE stubborn = true

Re: Perseverance in the Face of Change Requests

2007-12-03 09:13 • by Pyro (unregistered)
I predict a lot of self-joins in their queries :)

Re: Perseverance in the Face of Change Requests

2007-12-03 09:14 • by Southern (unregistered)
Brevity is the soul of wit ..

captcha, onomatopoeia. cool.

Re: Perseverance in the Face of Change Requests

2007-12-03 09:15 • by DOA
I just got this mental image of a kid too dumb to put the right block in the right hole (you know the toy I'm talking about) so instead it's making it fit in the wrong one with a hammer.

Re: Perseverance in the Face of Change Requests

2007-12-03 09:27 • by TallGuy (unregistered)
163798 in reply to 163789
Strider:
Bartman:
Parts is parts.


Except for when Parts.isNotParts


Alternatively:

SELECT * FROM Parts WHERE Parts.isNotParts = FILE_NOT_FOUND.

Re: Perseverance in the Face of Change Requests

2007-12-03 09:31 • by Jon H (unregistered)
Normalization is just a fad right? :)

Re: Perseverance in the Face of Change Requests

2007-12-03 09:35 • by bg (unregistered)
Real programmers don't use databases.

Re: Perseverance in the Face of Change Requests

2007-12-03 09:44 • by Andy Goth (unregistered)
163801 in reply to 163800
Real programmers don't use data.

Re: Perseverance in the Face of Change Requests

2007-12-03 09:46 • by TcH (unregistered)
163802 in reply to 163801
Real programmers don't.

Re: Perseverance in the Face of Change Requests

2007-12-03 09:46 • by too embarrassed to fill in (unregistered)
Sorry, but I must be slow today. What was the developer's intention with Part.isNotPart? Is that a bool or the assembly name or what?

Re: Perseverance in the Face of Change Requests

2007-12-03 09:50 • by Stupidumb (unregistered)
163804 in reply to 163803
too embarrassed to fill in:
Sorry, but I must be slow today. What was the developer's intention with Part.isNotPart? Is that a bool or the assembly name or what?


LOL, You mean you don't know?!?!?!?! LOL LOL>> I Bet yoou are not a good programmer. LOL ROFL LOLLOLOL . I am a hxors and I know. LOLOLOL. You are dumb, LOLOL.

captcha: ninjas. YES NINJAS YES LLOLOLOL

Re: Perseverance in the Face of Change Requests

2007-12-03 10:01 • by spamguy (unregistered)
163807 in reply to 163802
Real programmers?

Re: Perseverance in the Face of Change Requests

2007-12-03 10:01 • by Rene (unregistered)
163808 in reply to 163803
The idea is, rather than handling the concept of an assembly properly, he sets 'IsNotPart' to indicate that it's an assembly rather than a part, unless I'm completely misreading this WTF.

Re: Perseverance in the Face of Change Requests

2007-12-03 10:03 • by Fr (unregistered)
163809 in reply to 163803
too embarrassed to fill in:
Sorry, but I must be slow today. What was the developer's intention with Part.isNotPart? Is that a bool or the assembly name or what?


Based on standard naming conventions I would say it is a boolean.

Over all not a really big WTF, table name could of been better, you have a seperate table which was used to store the catalog desciption and instead of just carring single parts they are now carring assemblies. Assemblies still need a part number and a description and instead of creating a new table and join them in they just added to the existing tables then in the description table added a column to indicate it is not a part in the way other others are a part.
Most likly this is for an automotive catalog, they still refer to everything as a part even if it an assembly.

Re: Perseverance in the Face of Change Requests

2007-12-03 10:03 • by Not_A_Jerk (unregistered)
Sorry, but I must be slow today. What was the developer's intention with Part.isNotPart? Is that a bool or the assembly name or what?


The purpose was to store assemblies of parts, groups of parts, if you will; think of an assembled radiator with cooling fan and wiring harness. You could perhaps purchase this entire assemblage as one SKU. So, instead of creating a new table, called Assemblages, or something, they added this retarded field to their parts table.

Re: Perseverance in the Face of Change Requests

2007-12-03 10:04 • by K Klein (unregistered)
Pehaps if the column was named "IsAssembly" rather than "IsNotPart" there'd be no WTF?

Re: Perseverance in the Face of Change Requests

2007-12-03 10:05 • by Fredrik (unregistered)
163812 in reply to 163807
spamguy:
Real programmers?


Real

Re: Perseverance in the Face of Change Requests

2007-12-03 10:07 • by Sgt. Preston (unregistered)
163813 in reply to 163803
too embarrassed to fill in:
Sorry, but I must be slow today. What was the developer's intention with Part.isNotPart? Is that a bool or the assembly name or what?

I suspect that, rather than create an assemblies table and a linking table to associate parts with assemblies, the developer simply added assemblies to the parts table with an IsNotPart flag to distinguish assemblies from parts. It's the one-table-fits-all solution.

Re: Perseverance in the Face of Change Requests

2007-12-03 10:11 • by Sgt. Preston (unregistered)
Good point.

Re: Perseverance in the Face of Change Requests

2007-12-03 10:11 • by GettinSadda
163816 in reply to 163812
Fredrik:
spamguy:
Real programmers?


Real

Re: Perseverance in the Face of Change Requests

2007-12-03 10:21 • by J. Fryman (unregistered)
163817 in reply to 163816
GettinSadda:
Fredrik:
spamguy:
Real programmers?


Real


ERR: DIVBYZERO

Re: Perseverance in the Face of Change Requests

2007-12-03 10:22 • by n9ds
So if you want a part, you select for NOT PART.ISNOTPART ?

Re: Perseverance in the Face of Change Requests

2007-12-03 10:23 • by Grovesy
163819 in reply to 163809
Fr:
too embarrassed to fill in:
Sorry, but I must be slow today. What was the developer's intention with Part.isNotPart? Is that a bool or the assembly name or what?


Based on standard naming conventions I would say it is a boolean.

Over all not a really big WTF, table name could of been better, you have a seperate table which was used to store the catalog desciption and instead of just carring single parts they are now carring assemblies. Assemblies still need a part number and a description and instead of creating a new table and join them in they just added to the existing tables then in the description table added a column to indicate it is not a part in the way other others are a part.
Most likly this is for an automotive catalog, they still refer to everything as a part even if it an assembly.



No really, it is a major WTF.. It's a part by definition of being having a row in the parts table.

Or to put it more logicaly

We have three predicates e.g.

'The Part identified by p_id Can be supplied'
'The Assembly identified as a_id, is an assembly'
'The Assembly identified by a_id Uses Part p_id'

And some propositions...
The Part P1, can be supplied.
The Part P2, can be supplied.

A1 Is an assembly

The Assembly A1, uses Part P1
The Assembly A1, uses Part P2

All makes, sense and everyone can understand the rules here... I hope the corresponding SQL DB design would consist of three tables. (Assemblies, parts, assembly_parts'


Except... according to their design, they simply have a Part called 'P3' which isn't really a part, it's an assembly.... Overall, not very intuitive.




Re: Perseverance in the Face of Change Requests

2007-12-03 10:35 • by Noser (unregistered)
I just have to say I love the title of this article.

Re: Perseverance in the Face of Change Requests

2007-12-03 10:39 • by K Klein (unregistered)
No really, it is a major WTF


Please don't get anywhere near my parts database.

An Assembly can be modeled as a subclass (specialization) of a Part. One valid way to map this object model to a relational model is to store the two classes in the same table and use a discriminator column to identify the specific subclass.

The only WTF here is the stupid column name.

Re: Perseverance in the Face of Change Requests

2007-12-03 10:44 • by Daigo (unregistered)
Personally, I think that in some cases you could implement the solution with only two tables. Supposing that:
- Every part could belong to an assembly, and assemblies can be sold as parts.
- More than one level of grouping is needed, i.e. an assembly can belong to another assembly as well.

You could use the "Parts" table to store both parts and assemblies, and an "Assemblies_Parts" table to store the relationship.

I had to deal with this kind of structure in the past and the major drawback was trying to avoid infinite recursion, like "Assembly A includes Assembly B which includes Assembly A", but, if well planned, it can be a "general purpose" solution.

Re: Perseverance in the Face of Change Requests

2007-12-03 10:51 • by pscs
163823 in reply to 163819
Grovesy:
No really, it is a major WTF.. It's a part by definition of being having a row in the parts table.


I'm not sure. We'd need more information really.

This is for a catalogue, so if they have boxes full of parts to sell, and boxes full of pre-packaged assemblies to sell, it's not a WTF IMHO (OK, so the table name could have been something other than 'Parts', but that's very minor).

Eg, if someone sells individual AA batteries, and also sells packs of 4 or 12 AA batteries, it wouldn't necessarily be wrong to have that as three different items with no links between them in a database IMHO.

OTOH, if they just have boxes full of parts to sell, and assemblies are made up of parts at the time of selling/dispatch, then it's a lot more major - eg there would be no way to tell if an assembly is in stock as there's no way to link an assembly to its constituent parts, and packing notes couldn't automatically be produced and so on.

OYAH, if this table had absolutely nothing to do with anything other than generating the catalogue, then it's probably not a WTF from the developer's POV either, but it might be from whoever else decided the data needed entering twice.

Re: Perseverance in the Face of Change Requests

2007-12-03 10:53 • by Grovesy
163824 in reply to 163821
K Klein:
No really, it is a major WTF


Please don't get anywhere near my parts database.

An Assembly can be modeled as a subclass (specialization) of a Part. One valid way to map this object model to a relational model is to store the two classes in the same table and use a discriminator column to identify the specific subclass.

The only WTF here is the stupid column name.


Ok, let’s go one step further and introduce components into the mix, along with

Part {Id, description, IsPart, IsComponent}


Or perhaps another parallel

Department, Product Range, Products, SKU's… I really hope you wouldn’t suggest a database design of

Product {id, name, description, size, colour, isRange, isProduct, isSKU, stockCount}

Re: Perseverance in the Face of Change Requests

2007-12-03 10:55 • by bdew (unregistered)
Oh come-fucking-on, not another ZOMG NORMALIZE EVERYTHING WTF...

If asemblies and parts have the same semantics in most of the app, it's much better than creating 2 additional tables and then duplicating half your code

Re: Perseverance in the Face of Change Requests

2007-12-03 10:59 • by Grovesy
163826 in reply to 163823
pscs:


Eg, if someone sells individual AA batteries, and also sells packs of 4 or 12 AA batteries, it wouldn't necessarily be wrong to have that as three different items with no links between them in a database IMHO.


Well, in this case.. you have a classic Product, SKU structure

Product - 'BrandName AA'
SKU (what you actually stock) - Single, 4Pack, 12Pack,

Or alternatively, if you store single AA batteries in your warehouse and apply a discount for bulk sales (e.g. 1,4,6,12..) then you would deal with that in your discount structure

Re: Perseverance in the Face of Change Requests

2007-12-03 11:07 • by sweavo (unregistered)
163828 in reply to 163811
K Klein:
Pehaps if the column was named "IsAssembly" rather than "IsNotPart" there'd be no WTF?


Uh, you need a column called 'IsPartOf' containing the ID of another part, if we really wanna get recursive.

Advantages:
* everything a part can do, an assembly can do
* therefore, assemblies can have sub-assemblies

Disadvantages:
* Much Abjuring of Demons required if stupid people get at the database


Re: Perseverance in the Face of Change Requests

2007-12-03 11:11 • by Grovesy
163829 in reply to 163825
bdew:
Oh come-fucking-on, not another ZOMG NORMALIZE EVERYTHING WTF...

If asemblies and parts have the same semantics in most of the app, it's much better than creating 2 additional tables and then duplicating half your code


Well, your counter design would end up with a more complex set of constraints. (of the top of my head)

-A Part that is a part must have a parent part
-A parent part cannot be part
-A part that is not a part cannot have a parent part

Re: Perseverance in the Face of Change Requests

2007-12-03 11:19 • by Me (unregistered)
163832 in reply to 163821
K Klein:
No really, it is a major WTF


Please don't get anywhere near my parts database.

An Assembly can be modeled as a subclass (specialization) of a Part. One valid way to map this object model to a relational model is to store the two classes in the same table and use a discriminator column to identify the specific subclass.

The only WTF here is the stupid column name.


Right on. If the higher assembly has a distinct part name it belongs in the parts table, with a join table linking it to its sub assemblies, some of which may be parts or other assemblies. Absolutely nothing wrong with it. Fact is, you don't even need that additional column really, since a parts presence in the subassembly join table indicates it is an assembly. This is not a WTF.

CAPTCH "dreadlocks" As a DBA, yes, I do.

Re: Perseverance in the Face of Change Requests

2007-12-03 11:27 • by Grovesy
163835 in reply to 163832
Me:
K Klein:
No really, it is a major WTF


Please don't get anywhere near my parts database.

An Assembly can be modeled as a subclass (specialization) of a Part. One valid way to map this object model to a relational model is to store the two classes in the same table and use a discriminator column to identify the specific subclass.

The only WTF here is the stupid column name.


Right on. If the higher assembly has a distinct part name it belongs in the parts table, with a join table linking it to its sub assemblies, some of which may be parts or other assemblies. Absolutely nothing wrong with it. Fact is, you don't even need that additional column really, since a parts presence in the subassembly join table indicates it is an assembly. This is not a WTF.

CAPTCH "dreadlocks" As a DBA, yes, I do.


I'd buy that, if parts and assemblies were the same.. e.g. Parts are made up of parts... Such a database design would make sense. So the WTF is the existance of IsPart and it's name

I just get the impression from Alex's story that they are not..

Re: Perseverance in the Face of Change Requests

2007-12-03 11:35 • by Grovesy
163837 in reply to 163835
Another bit that suggests doom is

'strSql = "SELECT...

which implies that Stored procedures happend to other people.. Lots ofAd-hoc queries all over the system (maybe several systems) anyone?

Re: Perseverance in the Face of Change Requests

2007-12-03 11:56 • by Fuji (unregistered)
If you're using IsNotPart as a property of Part to define something that it is not, then why stop there?

Part.IsNotBananas
Part.IsNotPenguin
Part.IsNotMohorovičićDiscontinuity

etc.

Re: Perseverance in the Face of Change Requests

2007-12-03 12:23 • by ForcedSterilizationsForAll (unregistered)
163859 in reply to 163812
Fredrik:
spamguy:
Real programmers?


Real


NULL

Re: Perseverance in the Face of Change Requests

2007-12-03 12:34 • by Crash Magnet (unregistered)
What is the difference between a part and an assembly?

A part is a single item, while an assembly has a BOM (Bill of Materials). A BOM is just a list of parts or other assemblies.

If the application is some kind of POS or item tracking system, then <sarcasm>"What's the difference?"</sarcasm>

If the application is some kind of Manufacturing MRP, "Get out now while you still have a chance."

Crash Magnet

Re: Perseverance in the Face of Change Requests

2007-12-03 12:42 • by akatherder
They decided to start storing customers in the table too. To get a list of parts:

Part.IsNotPart = 0 AND Part.IsNotCustomer = 1

//Please note Customer name is stored in part.description.

Re: Perseverance in the Face of Change Requests

2007-12-03 12:43 • by Cloak (unregistered)
163864 in reply to 163800
bg:
Real programmers don't use databases.


That was also the lead programmers opinion. It's most often bad if a programmer designs a database.

Re: Perseverance in the Face of Change Requests

2007-12-03 12:45 • by Cloak (unregistered)
163865 in reply to 163807
spamguy:
Real programmers?


Real?

Re: Perseverance in the Face of Change Requests

2007-12-03 13:03 • by drank (unregistered)
Really, there's not enough information here to say if this is a major WTF. I can certainly imagine that this is a literal-minded O-R mapping. Assembly could easily be a subclass of Part, and they get used in similar ways in the application (think "we sell both assemblies and parts, we just shown them on different screens"). So the quickest way to persist them both would be to put them in the same table and add a column to distinguish the subclass. If that's the case, then at most this is an issue of a poorly-named column.

On the other hand, if Assemblies are treated by the software as collections of parts or nested collections of parts, then you do need a more complex schema to describe it properly. But the submission doesn't show us any more of the schema, so we have no idea how (or if) that's implemented.

For stories like this, I'm always suspicious that the submitter simply didn't understand the software design in question.

Re: Perseverance in the Face of Change Requests

2007-12-03 13:06 • by d++
I decline to omit an opinion before knowing about the time frame. If I was working in this project for 3 months and someone came up with a 'Change Request' to support Assemblies 1 week before going live, I would go with the extra column (and call it IsNotFxxxPart)!

Re: Perseverance in the Face of Change Requests

2007-12-03 13:34 • by will (unregistered)
163877 in reply to 163807
spamguy:
Real programmers?


Yea its those programmers that work in Madrid.

Re: Perseverance in the Face of Change Requests

2007-12-03 13:35 • by Some Poor Bastard (unregistered)
163878 in reply to 163825
bdew:
Oh come-fucking-on, not another ZOMG NORMALIZE EVERYTHING WTF...

If asemblies and parts have the same semantics in most of the app, it's much better than creating 2 additional tables and then duplicating half your code


You are correct, sir. I'm am living this nightmare right now in my current job. Three large tables; every significant piece of SQL requires two UNION statement; every significant piece of Java requires conditional logic.

If this wasn't enough, the view layer uses a technology that allows conditional logic. So every significant display template also uses conditional logic.

I pity the foo' who thinks this WTF is really a WTF!

Re: Perseverance in the Face of Change Requests

2007-12-03 13:53 • by CodeRage
163882 in reply to 163812
Fredrik:
spamguy:
Real programmers?


Real


Top
« PrevPage 1 | Page 2 | Page 3Next »

Add Comment