Powered by Twitter Tools.

July 2006
M T W T F S S
« Jun   Aug »
 12
3456789
10111213141516
17181920212223
24252627282930
31  
Chris Donnan

Create Your Badge

Chris Donnan : Programming – Brooklyn Style

software, trading, family, fun

2 Super Base Class – I love inheritance

extreme_rant <<

Kill me please.

I am a Super Base Class. I am 6000 lines long. I have 150 ‘functions’ (I will not grace them by calling them methods). I also have 200 fields! I am sorta-kinda just like an old C program. The cool thing about it me – is that if you just inherit from me – you get all of my functions. Wow – isn’t inheritance awesome!

Kill me please.

Since the only way to use me – is to derive from me (I am cool and abstract) – I have proliferated greatly. I have more than 30 bastard children. Each needs maybe 1 method -er; function – but – they are all my kids anyhow. Some are doctors, some are lawyers, some are janitors. They each need some small part of me – as I am SUPER! I AM ALL!

Kill me – really.

I am very protective over my fields – they are all ‘protected’ – every field. After all – I want to share with my children! I am very open with my functions, but open to change too – all my methods are public AND virtual :) Great!! I am just SOOOO flexible – it is great …. isn’t it?

AWESOME!

We ALL know the purpose of inheritance. It is so you can push ALL of the functions (functions are cool!) in your program down to the super base class – then – you just derive from it!! YES!! THAT IS IT!!

Since I have so many protected fields and so much code, so many fields, and I do SO many things. I like to have LOTS of side effects. This is a *really cool feature* I have. Since you can derive from me (as so many do) – you can also override my public members (remember they ARE virtual), there are just UNLIMITED possible states I can be in!!! I am the culmination of all possible side effects – and I am just – well – spontaneous. I do not really much like constraints, or guarantees. This is WAY too legalistic for a Super Base Class like me.

OOH OOH – here is another awesome feature…

Just to make it easier for my functions. I declare ALL of my variables at class level. Who needs to limit scope? Why bother. We are all friends here. I even leave around old friends. The functions we used to use. The variables we used to use. Since my variables are …around… I also think it is cool that I can sometimes use the same variables (fields – remember all class level fields) to do MANY MANY things. Why waste our friends – give them work since they are around.

One of my FAAAAVORITE things to do – is to reference ALL of my other quasi-super friends – via static references. We are all SOOO special – that we are ALL singletons. The net effect here is again reminiscent of a good-ole C program. We can use Object Oriented ’stuff’ AND STILL be procedural!!! Man are we awesome! GO GO GO GLOBALS – STATEFUL GLOBALS ROCK!!!

AAAAAAAAAAAARRRRRRRRRRGGGGGGGGGGGGGGGGGGHHHHHHHHHHH!!!!!!!!!!!!

-Chris (kill me)
PS – I am a windows form control – I provide ANY AND ALL SERVICES you may need! If you are elsewhere in the app – maybe not anywhere you ‘need’ a windows form control – STILL inherit from me!!!! I RULE — MMOOOHHAHAHAHAHAHA!!!!! ALL BOW BEFORE ME ….. SUPER BASE CLASS !!!!!

I AM SUPER (EVIL) BASE CLASS

RacerXMockUpMaskHero1a_G_B.jpg


You can leave a response, or trackback from your own site.



More reading – via Safari

Well – I am doing the Safari Subscription thing….. I am an info addict. Audible subscription, Safari subscription, magazines, more books …. AAAHHH. Love it.  Safari is pretty cool so far. Since I tend to read so much – this should make the bill a bit lower in general. I usually get my books from the Amazon.com marketplace for used books. This is a great cheaper mechanism than buying the books ‘brand new’. I still DO buy them brand new if the price is close etc, but – this on line bit with Safari works well for me.
Parallel and Distributed Programming Using C++

Great – unix-centric book on multi-threading, interprocess communication/ synchronization, etc. Also good coverage of MPI and distributed computing stuff. Like it lots – good book.

Prefactoring

I am not sold on this book yet. I will let you know when I have been through it. It is not that it is ‘wrong’ or ‘bad’ but I do not see anything novel yet.

Windows System Programming Third Edition

I just want to dig deeper and deeper into my (what I would humbly consider to be vast) knowledge of windows internals.  So far so good.
Mastering Algorithms with C

I have done my best to advise MANY of my friends, collegues, peers etc in the programming world about ‘how to get a better job’. Inevitably – knowing about datastructures, Big-O style notation, algorithms, etc comes up. I have given weaker references to ‘a good book on those topics’ in the past. Now – I will refer people to this book :) This is really a great book with pretty pics to help understand those topics. Even if you already understand those topics – it is still a well written book that talks about issues with different implementations of things like hashtables, trees, etc. Highly recommended!


You can leave a response, or trackback from your own site.



Artificial Immune Systems – AIS

I have long been interested in machine learning, AI, datamining, etc. One of the recently emerging (but not that ‘new’) areas in this space is Artificial Immune Systems (AIS).  Here is a great article for the beginner on the topic. It has examples in Delphi (pleasantly with unit tests). More importantly – it has nice pictures and explains the basics simply enough.

One of the things that I think is really interesting about this space is that there are lots of hybridizations. It is common to be using neural nets, evolutionary algorithms, AIS and reams of other techniques in one solution. The  No Free Lunch Theorem suggests that there will really never be a ’super algorithm’ that can work to solve all sorts of machine learning (and/ or optimization) problems with equal ability. This further implys that there will continually be the need for new algorithms/ techniques and tools to solve different kinds of problems. Put in the light of hybridized solutions for machine learning – the implication is that there will be lots of components to solve complex datamining/ optimization/ machine learning etc. problems. I am always enthusiastic when I see yet another emergent technique like AIS because this means that the components available to solve harder and harder problems are becoming available. The challenge of course is effectively understanding and combining these elements into effective devices for solving problems.

A few other interesting tangents

Swarm Intelligence
Ant Colony Optimization
Memetic Algorithms

A few great resources can take you far – they do cost a few $ however:

MIT Journal of Evolutionary Computation
IEEE Computer Society
IEEE Computational Intelligence Society

All great stuff

-Chris


You can leave a response, or trackback from your own site.



Test Drive Development Developer Session – Unit Testing and Mock Objects in .Net and Java

It is time for the next ‘Developer Session’ in my series … The last one that we did – Spring Framework Developer Session (code, power point) was a hit – with maybe ~40 people who came out to hear about Spring. I am happy to report the next dev session is:

Test Drive Development Developer Session
NUnit, JUnit; Rhino Mocks in .net and Easy Mock in Java

Tuesday July 25th 6 – 8 PM

228 East 45th Street
6th Floor
New York, NY 10017

These sessions ARE OPEN TO THE PUBLIC – There is a snack before we get into it – then a presentation, demos and questions.

The sessions I have planned remaining are :

The Peer Frameworks Series – .Net and Java

3) Db4o Developer Session – Open Source Object Database in .net and Java
4) ORM Developer Session – Hibernate, NHibernate / IBatis

I will update the agenda as we finish planning it in the next week or so. I hope to have dial in access for people that want to dial in – and ideally a ‘webex’ type access as well. Feel free to contact me with any comments or questions. Also please message me to let me know if you want to attend – here test-driven-dev-session@chrisdonnan.com. This will help us plan food, chairs – etc.

I will be focusing on:

NUnit
Rhino Mocks
Junit
Easy Mock

My Best;
Chris


You can leave a response, or trackback from your own site.



db4o book … and a few others

Books books books books….

The folks @ db4o were kind enough to send me a copy of the new book “The Definitive Guide to db4o” today. A few months back I filled out some survey for them – lo and behold – free book :) Since i am a book junkie – this is of course pleasing. I have been talking about db4o for some time now – cool technology! My 1st quick flip was good – we’ll see how insightful the books is. 1 thing I can say so far is that I love that the software is for java and .net – so is the book.

I have also been trying to get around to reading “My Life as a Quant : Reflections on Physics and Finance”. After chatting with a collegue today about it – he was kind enough to lend it to me… Since I am on Wall St these days – and I know lots o quant folks, seems right up my alley. I am sort of a wanna-be-quant myself – just under-qualified :)

Since I am mentioning books – I also have this one on the way – C++ GUI Programming with Qt 4 I love linux, I love desktop apps (been doing desktop app frameworks for some time now). Need to get up to speed on KDE/ QT development. I am particularly interested in perusing alternative event routing/ event bus techniques and the slots/ signals is a different paradigm then how you skink the events cat in .net.

… and this one :) (I am a fan of Robert Martin – Author 1, and I have a son named Micah, Author 2 – had to get it). From the description:

Readers will come away from this book understanding:

  • Agile principles, and the fourteen practices of Extreme Programming
  • Spiking, splitting, velocity, and planning iterations and releases
  • Test driven development, test first design, and acceptance testing
  • Refactoring with unit testing
  • Pair programming
  • Agile design and design smells
  • The Single Responsibility Principle and the Open Closed Principle
  • The Liskov Substitution Principle and the Dependency Inversion Principle
  • The Interface Segregation Principle, and Separation through Delegation and Multiple Inheritance
  • The five types of UML diagrams and how to use them effectively
  • Object-oriented package design and design patterns
  • How to put all of this together for a real-world project

The emphasis is mine – the things that I talk about all the time – really – and the things that stood out to me. While I have been doing ALL this stuff for some time now – introducing it to new people/ places is still hard sometimes. This all sounds like potential angles and ways to explain wins of these techniques :)
Agile Principles, Patterns, and Practices in C#

… the last one I have on the way is – Interface Oriented Design : With Patterns A portion of the description interested me … “You’ll learn by pragmatic example how to create effective designs composed of interfaces to objects, components and services.” I think I have read ALL the patterns/ practices books out there. There is not too much new under the sun in this space. That said – the fine points of composing a nice object model is still key and warrants discussion. People under and over use interfaces all too often. People also suffer from the pitfals of “infrastructure driven packaging” – and other poor componentization problems. Who knows – maybe this will be as good a read as the 1st prag prog book.

In case you cant tell – I REALLY value books, education … information. Believe it or not – I love all this stuff!

-Chris


You can leave a response, or trackback from your own site.



MVP, Commands and Actions – as they are happening in Spring.net Desktop Application Framework

I have been working to get some stuff together for a decent 1st release of the Spring .Net Desktop Application Framework – Spring.net DAF. I wanted to chat a bit here about the MVP (model view presenter), commands and actions.

In the past – I have seen some ‘fat controllers’ in .net Winforms apps. People try to ‘do the right thing’ and do an MV(C/P) – and seperate the view stuff from the control flow and the commands or tasks. After going through this many-o-time, I believe I have been able to model out a good set of constructs.

  • View – tries to perform Actions via it’s Presenter (user controls for the most part)
  • Presenter – has buckets of Commands and a View
  • Commands
    • Presenter Commands – automates the view and manages ‘non UI related tasks’ including background tasks.
    • Background Commands -reusable  – async units-of-work

The container

First and foremost – The UI Application Container should inject any needed dependencies into the UI. This includes bulding up the presenter, commands, etc. that a view is expecting.
View

<meta content="OpenOffice.org 2.0 (Linux)" name="GENERATOR" /><meta content="chris donnan" name="AUTHOR" /><meta content="20060705;264900" name="CREATED" /><meta content="16010101;0" name="CHANGED" /><br /> <style type="text/css"> <!-- @page { size: 8.5in 11in; margin: 0.79in } P { margin-bottom: 0.08in } --></style> <p>These are your friendly UserControls and forms. In essence, the goal is to keep the Views – dumb. The view should basically have an API so it can be implemented by person A (theoretically) and automated by some presenter yet to be implemented. Here is a simple button click – asking the presenter to handle an action being requested. The view can pass parameters with the Action in a CommandParameter list. These are typed via generics.<br /> <img alt="callAction.png" id="image170" src="http://chrisdonnan.com/blog/wp-content/uploads/2006/07/callAction.png" /></p> <p><span style="font-weight: bold">Presenter</span></p> <p>The Presenter is then free to do whatever it needs to – and then automate the View as needed.</p> <p>The presenter has it’s commands wired up via spring – like so….</p> <p><img alt="presenterCommandWiring.png" id="image171" src="http://chrisdonnan.com/blog/wp-content/uploads/2006/07/presenterCommandWiring.png" /></p> <p>This means that you can add in commands, change the implementation of a command, etc. Often – a ‘generic’ presenter can be used – that just wires commands to a view. These Presenter Commands have access to the Presenter and the View to do whatever they need to do. This means that all UI Operations can be canned up in a command – a single unit of work… nice, testable.</p> <p style="font-weight: bold">Commands</p> <p style="font-weight: bold"><span style="font-weight: normal">Here</span> <span style="font-weight: normal">is an admittedly useless command</span>:</p> <p style="font-weight: bold"><img alt="presenterCommand2.png" id="image173" src="http://chrisdonnan.com/blog/wp-content/uploads/2006/07/presenterCommand2.png" /></p> <p>This command is just wired to a name via spring. It does what it needs – in this case – just dealing with the view. In this ‘do execution’ method (a template method) – you could do whatever. This PresenterCommand class derives from PresenterCommand – a base class that does the basic PresenterCommand implementation – there is also a BackgroundPresenterCommand that could be derived from – providing more template methods – that would do ‘background work’.</p> <p style="font-weight: bold"><span style="font-weight: normal">Also note this command is ‘view cognisant’. There are also – in my way of thinking – non-view-cognisant background commands. I have called these ‘units of work’ in the past. These are typically called – in this model – in the PresenterCommands.</span></p> <p style="font-weight: bold">Command Parameters</p> <p style="font-weight: bold"><span style="font-weight: normal">Note the simple use of CommandParameters here too. This is a simple example of just getting the value of an expected parameter passed to this command via The Action’s CommandParameters.  The Command/ Command Parameters are loosely modeled off of the ADO Command/ Sql Parameters. My goal was to try to give metaphor that ‘feels normal’ to developers. I think the  level of usage that the ADO Commands have provide a  good baseline for usage.</span></p> <p style="font-weight: bold"><span style="font-weight: normal">This is just a quicky intro to what has been going on. Hopefully I will find the time to getting this stuff out there ASAP.</span></p> <p style="font-weight: bold"><span style="font-weight: normal">My best;<br /> Chris<br /> </span></p> <br><p> You can <a href="#respond">leave a response</a>, or <a href="http://chrisdonnan.com/blog/2006/07/05/mvp-commands-and-actions-as-they-are-happening-in-springnet-desktop-application-framework/trackback/">trackback</a> from your own site. </p> <div> <br> <div class="align-left"><h3></h3></div> <div class="align-right"><h3></h3></div> </div> </div> <!-- CLOSES ELVGREN POST DIV --> <br> <div class="elvgren-post"> <span class="elvgren-post-comments"> <a href="http://chrisdonnan.com/blog/2006/07/05/a-few-good-reads/#comments"></a> </span> <span class="elvgren-post-headline"> <a href="http://chrisdonnan.com/blog/2006/07/05/a-few-good-reads/" rel="bookmark" title="Permanent Link to A few good reads" >A few good reads</a> </span><br> <span class="elvgren-post-category">Posted <a href="http://chrisdonnan.com/blog/category/programming/" title="View all posts in programming" rel="category tag">programming</a> on Wednesday, July 5th, 2006. </span> <p>ala Martin and company – Events <a target="_blank" href="http://martinfowler.com/eaaDev/EventCollaboration.html">here</a> and Consumer-Driven Contracts <a target="_blank" href="http://martinfowler.com/articles/consumerDrivenContracts.html">here</a></p> <p><a target="_blank" href="http://martinfowler.com/articles/consumerDrivenContracts.html" />Jeremy Miller chats about MVP <a target="_blank" href="http://codebetter.com/blogs/jeremy.miller/archive/2006/02/16/138382.aspx?CommentPosted=true#commentmessage">here </a>and mocks <a href="http://codebetter.com/blogs/jeremy.miller/archive/2006/07/03/147075.aspx">here</a> (these are 2 of my favorite topcs – love this guys blog)</p> <p>Cool take on the news <a target="_blank" href="http://www.marumushi.com/apps/newsmap/newsmap.cfm">here</a> – via <a target="_blank" href="http://37signals.com/svn/">37Signals</a></p> <p><img src="http://static.flickr.com/57/178424647_ce4d7c1a80.jpg?v=0" /></p> <p>Google … still cool for geeks – <a target="_blank" href="http://www.nytimes.com/2006/07/03/technology/03google.html?_r=2&oref=slogin&oref=slogin">here</a></p> <p>….read on;</p> <p>Chris</p> <br><p> You can <a href="#respond">leave a response</a>, or <a href="http://chrisdonnan.com/blog/2006/07/05/a-few-good-reads/trackback/">trackback</a> from your own site. </p> <div> <br> <div class="align-left"><h3></h3></div> <div class="align-right"><h3></h3></div> </div> </div> <!-- CLOSES ELVGREN POST DIV --> <br> <div class="elvgren-post"> <span class="elvgren-post-comments"> <a href="http://chrisdonnan.com/blog/2006/07/03/re-org-of-my-home-network-setup/#comments"></a> </span> <span class="elvgren-post-headline"> <a href="http://chrisdonnan.com/blog/2006/07/03/re-org-of-my-home-network-setup/" rel="bookmark" title="Permanent Link to re-org of my home network setup" >re-org of my home network setup</a> </span><br> <span class="elvgren-post-category">Posted <a href="http://chrisdonnan.com/blog/category/computer-hardware/" title="View all posts in computer hardware" rel="category tag">computer hardware</a>, <a href="http://chrisdonnan.com/blog/category/linux/" title="View all posts in linux" rel="category tag">linux</a>, <a href="http://chrisdonnan.com/blog/category/programming/" title="View all posts in programming" rel="category tag">programming</a> on Monday, July 3rd, 2006. </span> <p>Well…. Since I got my new machines as seen in <a href="http://chrisdonnan.com/blog/2006/06/13/yet-another-new-edition-to-my-digital-life/">these</a> <a href="http://chrisdonnan.com/blog/2006/06/09/new-edition-to-my-digital-life/">posts,</a> I re-org’d my home network setup slightly.</p> <p>I have 2 ~300 gb external firewire drives. I use these as my ‘primary’ and ‘backup’ drives. Everything permanent goes on the primary and the backup is cloned daily. These drives are setup under Meme – a Suse machine. They are shared out to the LAN using NFS for other linux machines and Samba for other Windows clients.</p> <ul> <li>2 ~300 gb external firewire drives. ‘primary’ and ‘backup’ drives. primary cloned daily.</li> <li>Meme -  primary Suse linux server. AMD based 1 GB RAM</li> <li>Nemo – windows server – Windows XP Pro. AMD based 1 GB RAM</li> <li>HP – New machine -  primary windows desktop – AMD dual core 64 bit athlon. 2 GB RAM</li> <li>Plex – New notebook – dual boot – Suse 10.1/ Windows XP Pro (Usually Suse) – dual core – Intel Core Duo 2 GB RAM</li> </ul> <p>I went through setting up both Ubuntu and Kubuntu. Frankly – I just like the Suse distro. I have had a suse machine for some time now. The Meme machine was running Redhat for ~2 years — again, I am just so accustomed to the Suse distro, that I put it on all the machines.</p> <p>I have donated yet another notebook to a loved one. My Compaq notebook was great, but – it became unreliable. But for someone who wants to just check email etc – and has nothing – it is useful. So my brother in law is now the proud owner of it. The Sony (that I hated) before that Compaq has been serving my sister Jen and her husband (a mac lover) for some years now.</p> <p>Vista machine coming soon…<br /> -Chris</p> <br><p> You can <a href="#respond">leave a response</a>, or <a href="http://chrisdonnan.com/blog/2006/07/03/re-org-of-my-home-network-setup/trackback/">trackback</a> from your own site. </p> <div> <br> <div class="align-left"><h3></h3></div> <div class="align-right"><h3></h3></div> </div> </div> <!-- CLOSES ELVGREN POST DIV --> <br> </div> <div id="footer"> Few things in life are free: <a href="http://www.wordpress.org">Wordpress</a> is, and this is proudly powered by version 1.5 of it.<br> 17 marching ants built this page in 0.356 seconds. <a href="http://www.opensource.org/licenses/gpl-license.php" title="Released under the GPL - visit the link if you don't know what it is. Duh...">© 2002-2005</a>.<br> <a href="http://www.secretweaponlabs.com/words">Elvgren 1.0</a> by Denis Somar of <a href="http://www.secretweaponlabs.com">Secret Weapon Labs</a> </div> </div> </body> </html>