Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why design patterns are easier in dynamic languages
Message
De
10/02/2008 14:14:59
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
10/02/2008 14:00:29
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
01291156
Message ID:
01291222
Vues:
14
># of lines of code is, at best, a specious argument. A seasoned developer who has previously solved other problems may wind up leveraging previously-written code - the resulting # of lines might be longer...so what? That doesn't mean it's "less easy"

OK, then let us describe it in terms of what needs to be done and how it gets done. To apply a factory pattern, so that it can be used for

loObj=oFactory.create("mytoken")

there needs to be a factory.dbf (or other table), and the code in the factory class needs to

- get the table (make sure it is open etc),

- find the record with "mytoken" in the name field

- .newobject(classfield, classlibfield) with possible complication if parameters are to be passed to object's init

- return the object, or return .null. if anything is screwed up.

Now how do you do that in a static language?

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform