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:59:39
 
 
À
10/02/2008 14:14:59
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
01291156
Message ID:
01291240
Vues:
11
Spring Framework I mentioned in another post is designed support the factory pattern. Typically XML files are used to describe what classes need to get loaded for "mytoken"

>># 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?

(On an infant's shirt): Already smarter than Bush
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform