12.12.2012 Views

Teach Yourself Borland C++ in 14 Days - portal

Teach Yourself Borland C++ in 14 Days - portal

Teach Yourself Borland C++ in 14 Days - portal

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>C++</strong> Class Frameworks and the Visual Component Model<br />

The latest and greatest OWL is 5.0. OWL 5 represents significant enhancements to<br />

OWL 2.5. The primary changes come <strong>in</strong> new OWL classes that encapsulate the new W<strong>in</strong>32<br />

custom controls. OCF was also updated <strong>in</strong> the OWL 5.0 release.<br />

OWL’s strengths are considerable. First, it is an architectural wonder. It is obvious that OWL<br />

was very well thought out from the beg<strong>in</strong>n<strong>in</strong>g. I can’t say enough about my admiration for<br />

OWL designers Carl Qu<strong>in</strong>n, Bruneau Babet, and the other OWL team members. OWL is<br />

very OOP friendly and follows all the OOP rules. Its level of abstraction strikes a good balance<br />

between ease of use and power. OWL has one major advantage over its competitors: It can<br />

be used <strong>in</strong> both 16-bit and 32-bit programs. <strong>Borland</strong> has even emulated some of the<br />

32-bit custom controls for use <strong>in</strong> 16-bit programs. While these emulations are not perfect <strong>in</strong><br />

all cases, they are usable and give you a method of gett<strong>in</strong>g the 32-bit look and feel even <strong>in</strong><br />

16-bit programs.<br />

OWL also has its weaknesses. Ironically, one of OWL’s strengths leads, <strong>in</strong> some people’s<br />

m<strong>in</strong>ds, to one of its weaknesses. OWL has done a great job of encapsulat<strong>in</strong>g the W<strong>in</strong>dows<br />

environment and that is certa<strong>in</strong>ly a strength. Part of the problem with that level of<br />

encapsulation is that OWL is complex, and it is sometimes difficult to f<strong>in</strong>d your way around<br />

when you are first learn<strong>in</strong>g OWL. The complexity of OWL is considered by some to be one<br />

of its weaknesses. It takes time to master, no question about it. But once you have mastered<br />

OWL, you can be very efficient <strong>in</strong> writ<strong>in</strong>g W<strong>in</strong>dows programs.<br />

The Microsoft Foundation Class Library<br />

Sometime between OWL 1 and OWL 2, the Microsoft Foundation Class (MFC) Library<br />

was born. MFC is <strong>in</strong>cluded as part of Microsoft’s Visual <strong>C++</strong> compiler package. Actually,<br />

versions of MFC ship with compilers by Symantec, Watcom, and, believe it or not, <strong>Borland</strong><br />

(there may be others as well). Typically Microsoft has not licensed the most current version<br />

of MFC to other compiler vendors (Symantec and Watcom), but <strong>Borland</strong> <strong>C++</strong> 5.01 <strong>in</strong>cluded<br />

MFC version 4.1, which at the time was the latest version of MFC (a newer version, 4.2, came<br />

out shortly thereafter).<br />

It could be said that MFC is a different type of class library than OWL. MFC is less abstract<br />

and lies closer to the W<strong>in</strong>dows API. MFC’s strengths come <strong>in</strong> three primary areas. First, it<br />

is relatively easy to learn. (Understand that no <strong>C++</strong> framework deal<strong>in</strong>g with W<strong>in</strong>dows<br />

programm<strong>in</strong>g is go<strong>in</strong>g to be easy to learn, but MFC is a little easier to pick up than the<br />

competition.) It is easier to learn primarily because it is less abstract <strong>in</strong> some areas. If you are<br />

new to W<strong>in</strong>dows programm<strong>in</strong>g, you will probably f<strong>in</strong>d OWL and MFC about equal when<br />

it comes to learn<strong>in</strong>g the framework. If you are com<strong>in</strong>g from a C programm<strong>in</strong>g background<br />

and already know the W<strong>in</strong>dows API, MFC is almost certa<strong>in</strong>ly go<strong>in</strong>g to be easier to learn.<br />

137<br />

5

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!