IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Depending on the language...
PL/SQL objects (in 8i at least) required that the constructor have a parm for every single member in the class. If the class represented a huge table, the results were serious pain.

This has changed in 9, fortunately.

Not the case for your code, obviously.
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
New LRPD
"The results were serious pain."
-drl
New This is written in Java
The people who wrote this system thought they understood OO but really didn't. This is a system with methods hundreds of lines long, where many of the catch clauses are for Exception (in fact when I catch individual exceptions, in code reviews they tell me why write all those lines just catch Exception), a love of utility classes and static methods, etc. Whenever I suggest that a class should be responsible for some behavior directly related to itself, many times the answer is, write a utility class or a static method instead. This led to a completely idiotic database layer, instead of using a normal OO - Relational mapping tool they did the following.

select = DatabaseQueryFactory.createSelect();
\t\t\tselect.addField(DBScheme.MngObj.ENTITY_CONTAIN_LIMIT_cols.ECL_AMOUNT_LIMIT);
\t\t\t// add conditions

\t\t\t// first filter by customer ID on the containing id
\t\t\tselect.addCondition(DBScheme.MngObj.ENTITY_CONTAIN_LIMIT_cols.ECL_CONTAINING_ENTITY_TYPE_ID,
\t\t\t\t\t\t\t\tCondition.EQ, EntitiesTBP.TypesEnum.CUSTOMER);
WhereClause filter = new WhereClauseImpl();
\t\tfilter.add(new ConditionImpl(DBScheme.MngObj.CUSTOMERS_cols.C_CUST_ID, Condition.EQ, customerID));
...


To say I am a bit frustrated is an understatement.

New Nasty.
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
New Brings back bad memories
I took a job that sounded like it would be fun - writing financial code in C. The chief coder was sort of a dork but he had good equipment in the place and sounded like he was on top of things.

First day, I start looking over this code - it's hundreds and hundreds of lines long, if statements that went on for pages, tons of static variables, stupid use of h files to define functions - about every bad C practice you could imagine.

Some time in the first week he calls me into his office. I factored some of the tortured stuff he'd written into a manageable form and formatted it sensibly, and used ANSI prototypes and made sure everything had a defined type.

He didn't know what "void" was. This guy is hopping mad because he doesn't know what "void" means. Then he starts in on the reformatting. Then the naming convention I used. Then the factoring into smaller functions. On and on. He had no standard, but mine was unacceptable. He didn't know how to actually write C code, but mine was unacceptable.

I lasted 2 weeks (enough to get 1 paycheck). Never forget his name - Richard call me Richard. "Mornin' Rich." "It's Richard." "OK."

You should get a chance to look over code before taking a coding job. The funny thing is, that shitty Java you're looking at was probably written by someone whose resume was loaded with Java and was filled with various whoppers. H1B maybe. Expert.

-drl
New Interesting point
The company I currently work for is a very successful software company that is growing. I expected to come in and be impressed by their development skills, processes etc. After 3 months, I am amazed that they can get a product out the door. The best people I ever worked with were some ex-Smalltalkers who had a small consulting firm and worked for a large bank. We worked on Java from 1997-1999 and did some amazing stuff. I truly believe that Smalltalk programmers are some of the few who really grok OO. C/C++ people usually think they do but don't.
New Re: Is written in Java?
Remeinds me of some stuff from a Ukrainian outsourcing company I had the misfortune to encounter last summer.

[persistance code longer and uglier than straight JDBC [but not _quite_ as ugly as your example], MFC style naming conventions infecting Java code]
New Yes, by people with C/C++ (MFC) experience
New Two points
Er...PL/SQL - from 7+ at least - can do either positional arguments or named arguments.

ie:
    foo ( argument1, argument2, ... argumentN)
or
    foo ( arg1=argument1, argN=argumentN, etc)

2nd - create a second constructor and use polymorphism to reduce the number of arguments.

ie:
    foo (argument1, argument2, ... argumentN)
    foo (argument1, argument2) { foo(argument1,argument2, argument3 = null; argument4 = null; ... argumentN = null)) };
New Re: Two points - well, you're half right.
1) Correct, but this has nothing to do with the point I was making.

2) Incorrect. In Oracle 8 there is one constructor, which takes all of the object's members as arguments. This is required as you may not set default values for arguments in the constructor. The workaround is to create static factory methods (NOT constructors) that internally create default values and call the system constructor with all of the attributes set appropriately.

I'm not quite sure why you called this "polymorphic", either. There ain't no sich thang in Oracle 8i. What you're talking about is "overloading", which can be done in 9.
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
New "Static factory methods", constructors - what's the diff? (new thread)
Created as new thread #143210 titled [link|/forums/render/content/show?contentid=143210|"Static factory methods", constructors - what's the diff?]


   [link|mailto:MyUserId@MyISP.CountryCode|Christian R. Conrad]
(I live in Finland, and my e-mail in-box is at the Saunalahti company.)
You know you're doing good work when you get flamed by an idiot. -- [link|http://www.theregister.co.uk/content/35/34218.html|Andrew Wittbrodt]
New You're right...
I was thinking of the parameter passing aspect of PL/SQL (from 7+), not the constructor aspect they added in later on.

You're quite correct also, that I'm thinking of overload rather than polymorphism. I had also switched from Oracle to Java (because I still don't think of PL/SQL as OO language).

I'm not sure that a static factory method would be required in this case for Java, if the constructor can be overloaded to default the values.
New Not required in Java.
The default constructor in Java sets no values at all, in fact.
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
     Constructor with 29 parameters - (bluke) - (20)
         **boggle** - (deSitter)
         Depending on the language... - (admin) - (12)
             LRPD - (deSitter)
             This is written in Java - (bluke) - (5)
                 Nasty. -NT - (admin)
                 Brings back bad memories - (deSitter) - (1)
                     Interesting point - (bluke)
                 Re: Is written in Java? - (dlevitt) - (1)
                     Yes, by people with C/C++ (MFC) experience -NT - (bluke)
             Two points - (Simon_Jester) - (4)
                 Re: Two points - well, you're half right. - (admin) - (3)
                     "Static factory methods", constructors - what's the diff? (new thread) - (CRConrad)
                     You're right... - (Simon_Jester) - (1)
                         Not required in Java. - (admin)
         29 parameters, all positional? - (ben_tilly) - (1)
             You got it - (bluke)
         Kill the author - (tuberculosis) - (1)
             No one there would understand - (bluke)
         A dictionary array is nice for such -NT - (tablizer)
         Try partial application wrappers? -NT - (FuManChu)

China...
91 ms