Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why design patterns are easier in dynamic languages
Message
From
10/02/2008 14:14:59
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01291156
Message ID:
01291222
Views:
16
># 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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform