Making & Saving Money with Open Source Kevin Hock, CS/SAN 2002 Jeremy Harning, CSA 2004
What is Open Source? Code is free Code is free Public collaboration Public collaboration Licenses – not always free to use Licenses – not always free to use
Examples of Open Source Linux Linux Apache Apache MySQL MySQL PostegreSQL PostegreSQL PHP PHP Firefox Firefox OpenOffice OpenOffice DOSBox DOSBox Azureus Azureus wxWidgets wxWidgets
Making & Saving Money Use open source Use open source Sell services based on open source Sell services based on open source Provide self-support Provide self-support Provide support to others Provide support to others Provide training Provide training Write books or articles Write books or articles
My experience with O.S. Web hosting: OxONet Web hosting: OxONet Application development: BitWise IM Application development: BitWise IM Written a book & article: wxWidgets Written a book & article: wxWidgets
OxONet - Overview Web hosting & design since 1999 Web hosting & design since 1999 LAMP and more LAMP and more No cost for software (except…) No cost for software (except…) Low startup cost Low startup cost
OxONet – Making money Configure “off the shelf” free software Configure “off the shelf” free software Provide bandwidth & space (not free!) Provide bandwidth & space (not free!) Sell to many Sell to many Our costs: Our costs: –Knowledge –Time –Hardware –Bandwidth
OxONet – O.S. Used Linux Linux Apache Apache MySQL MySQL PostgreSQL PostgreSQL php php Perl Perl Ruby Ruby Redhat Linux ES 4.0 Redhat Linux ES 4.0 Sendmail Sendmail Webalizer Webalizer Clamav Clamav SpamAssassin SpamAssassin Mailman Mailman SquirrelMail SquirrelMail
OxONet – Caveats Providing support Providing support Availability & reliability Availability & reliability Maintaining hardware & software Maintaining hardware & software Support for us Support for us Horror story Horror story
BitWise IM - Overview Instant messaging service Instant messaging service Professional version for business Professional version for business Developed using mostly open source Developed using mostly open source
BitWise – Making Money Provide secure IM to business Provide secure IM to business Provide premium IM to individuals Provide premium IM to individuals Software and service create value Software and service create value
BitWise – O.S. Used wxWidgets wxWidgets Crypto++ Crypto++ Speex Speex PortAudio PortAudio zlib zlib tiff, jpg, png tiff, jpg, png GTK GTK gcc / gdb gcc / gdb KDevelop KDevelop cvs cvs ssh ssh phpBB phpBB phpMyAdmin phpMyAdmin MediaWiki MediaWiki
BitWise - Problems Sub-optimal development conditions Sub-optimal development conditions Lack of documentation & support Lack of documentation & support Open source can be abandoned Open source can be abandoned Waste time in source code Waste time in source code
BitWise - Caveats Support, availability Support, availability Time cost Time cost Advertising Advertising Scrutiny Scrutiny
wxWidgets - Overview Cross-platform GUI library Cross-platform GUI library Open source, generous license Open source, generous license Used to develop BitWise Used to develop BitWise
wxWidgets Involvement User User Bug reports Bug reports Patches Patches Bug & patch manager Bug & patch manager CVS access CVS access Book Book Guru Guru
wxWidgets – Making $ Write programs Write programs Write books & articles Write books & articles Future – paid support? Future – paid support? Future – advocate? Future – advocate?
wxWidgets – Caveats No official support No official support Meandering goals & directions Meandering goals & directions Lack of financing Lack of financing Sometimes incomplete Sometimes incomplete
NHibernate - A Case Study - Overview Background Background Implementation Implementation Advantages/Disadvantages Advantages/Disadvantages Questions Questions
Background – Tiered architecture UI Layer Business Layer Data Layer Entities Web Service Interface
Background – Common App Problem: Dynamic SQL Older design patterns (solutions) Older design patterns (solutions) –1. Dynamically build SQL strings Problems Problems –SQL Injection –UI Managing business rules –Not parameterized SQL so does not get cached in DB –2. Stored Procedures Problems Problems –Need different SP for virtually every use case –Most developers can model data but aren’t DBA’s –Biz rules still being managed mostly in a different tier –NOT AGILE!!!
Implementation – Common App Problem: Dynamic SQL The ORM solution (NHibernate) The ORM solution (NHibernate) –Map business entities directly to database tables using XML (Code Generation) –Write a transaction manager class to manage NHibernate transactions that accepts an “Entity Base” class –FOCUS ON UI DEVELOPMENT Current project over 1000 use-cases Current project over 1000 use-cases –FOCUS ON BUSSINESS RULES Current project over 8,100 biz rules Current project over 8,100 biz rules –FOCUS ON SPEED TO VALUE Iterative development – easy to leave selected functionality out in order to get something valuable for the client quickly Iterative development – easy to leave selected functionality out in order to get something valuable for the client quickly
Implementation – Getting data out of the DB Inherit all entities from a base class Inherit all entities from a base class Code in terms of objects not tables Code in terms of objects not tables Criteria classes provided for you Criteria classes provided for you –Operators for >,, <, !=, ==, etc. –Specialized database operators –Mapped relationships implicitly filter based on criteria Transaction manager returns entities and lists of entities as opposed to data tables and data rows which are cumbersome Transaction manager returns entities and lists of entities as opposed to data tables and data rows which are cumbersome HQL – rarely necessary HQL – rarely necessary
Implementation – Putting data in the DB Simply call Save(EntityBase) on the transaction manager object Simply call Save(EntityBase) on the transaction manager object –Is designed to be smart enough to know whether add or update NHibernate uses XML files previously generated to determine key properties on object NHibernate uses XML files previously generated to determine key properties on object One-To-Many, Many-To-One relationships are supported One-To-Many, Many-To-One relationships are supported Many-To-Many (join tables) are implemented as a separate entity objects Many-To-Many (join tables) are implemented as a separate entity objects
Advantages and Disadvantages Advantages Advantages –FREE!! –Super Agile –Transactional biz rules are managed in the proper layer Disadvantages Disadvantages –Lack of support/documentation
Issues in Open Source Is making a profit on open source “wrong?” Is making a profit on open source “wrong?” Will open source kill commercial software development? Will open source kill commercial software development? Does open source produce better software? Does open source produce better software? Fast, Right, Cheap. Pick 2. Does this apply? Fast, Right, Cheap. Pick 2. Does this apply? Does lack of supervision / management hurt? Does lack of supervision / management hurt? Can open source provide support needed by big business? Can open source provide support needed by big business? Will open source kill innovation by eliminating R&D funding? Will open source kill innovation by eliminating R&D funding?