WinBatch and Object Oriented Programming, it's possible

Started by jonathanfishbein1, December 04, 2014, 02:04:19 PM

Previous topic - Next topic

jonathanfishbein1

Winbatch in combination with COM can utilize custom classes for data storage and retrieval.  Custom classes can be created in Visual Studio with getters/setters, private data members and more sophisticated data structures such as ArrayLists.  These custom classes can be compiled into COM interfaces and then accessed by Winbatch via the ObjectCreate() function.

td

Strictly speaking using an object is not the same thing as performing Object Oriented Programming.  And while COM has classes and objects it does not meet the generally accepted definition of being Object Oriented.   To perform OOP you need a language with built-in support for encapsulation, inheritance and polymorphism.  WinBatch does not natively support these features.

That said, WinBatch can consume OOP implemented objects via its dotNet subsystem.  You can also in-line compile C# programs in a WinBatch script using the FCL's C# compiler so you don't even need Visual Studio to generate  objects for WinBatch consumption.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade