64 Bytes

just a few characters short of a code base.

Open Vote Framework... Brain candy that might be worth building.

clock November 3, 2008 02:34 by author josh

So in this election year I have spent a lot of time thinking about voting and technology.. I see a lot of purpose built and closed systems outthere, and there are a few open systems.. But in my limited research I haven'tseen talk of but no action on a truly open source voting framework.. What I amtalking about is a series of services that would create a secure votingsystem.. Here are the design goals I am considering for this project.

  • Distributed & Self healing data model :  The actual votes should be stored in multiple locations with enough parity between each location that N number of locations can be compromised and the results from the vote still be trusted and valid.
  • Self recounts: This is something I did in a Voting system for an NPO many moons ago.. No user vote was ever associated with a specific user BUT all user votes were given an ID.. The User (Voter) was given the ID and could look up their vote any time.. In these cases when the voting base doesn't trust the results, they can still validate that their vote WAS recorded correctly.. This would allow grass root organizations to do "pseudo" recounts on their own using information they gather from voters about the accuracy of their vote and some statistical analysis.. if things seem TOO far out of whack then actual recounts can be executed.
  • Scoped Voting: This is something that has bugged me for a LONG time.. If I am a voter who lives in a state but I go to the wrong polling place my entire VOTE is provisional or void.. I would suggest that disenfranchising these voters we scope the vote.  After all National concerns like President and Senatorial elections are still valid for you. The rest of the ballet could be marked provisional.. The same could be true if you move from one part of a county to another.. Perhaps you can't vote in the congressional seat but you can on county bonds or state initiatives. By scoping the vote we allow voters a chance for their voice to be heard accurately and give them the dynamics they need.
  • Vote Anywhere: The goal here is to allow voters the opportunity to vote their specific ballot (based on their registration) regardless of their physical location or the polling station they actually vote at.. This could also extend to the web. This, specifically, isn't pie in the sky tech; Travis County Texas already did this using Hart Intercivics voting system at all of their early voting centers.
  • Hardware (and UI agnostic) : By this I mean that the application should be service based.. Private hardware providers should be allowed to build hardware or software that integrates with the voting service.  This is especially important when dealing with special needs voters. And of course this could allow for online or web based voting.
  • Deep but anonymous Logs and Auditing trails: By this we mean that actions should (for privacy) be anonymised from the specific user that executed them BUT there should be deep logging so that should a node in the service become invalid (see Distributed and Self Healing) that it can be analyzed to determine the true cause of the issue.
  • Voter Identity validation without ID: Using a series of questions & answers based on the user the identity of that use should be able to be validate to a level of certainty that is equal to or greater than that of forced State ID regulations.. This system could be used as a backup in locations where a person is missing their ID or for Online voting.

At thispoint its all just brain candy that I'm playing with. But I guess I have 4years to figure it out and get some of these ideas into code or architecture.  If your interested in these ideas or want to help let me know if there is enough backing I may start a formal project, otherwise I'll just tinker with it in my proverbial garage.

 

 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Linq Abstraction Screencast (or My first screencast, hope you like it).

clock December 16, 2007 07:52 by author Josh

Here it is, My first screencast. Like I pomised this screencast is about abstracting Linq Providers so that you can use what ever provide you want and keep your Business layer igorant.

(By the way, this i my first screencast, so no promises about quality. Oh and sorry for the annoying watermark. I know how to turn it off for the next screencast).

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Abstracting your Linq so it can be come one with IOC.

clock December 13, 2007 01:22 by author Josh

Last night I sat down and played with how I could abstract my linq so I could use any provider I wanted. This has been a common request on some of the forums I've been reading and so I figured I would give it a shot. Now this post is just a teaser, I am going to use this topic as my first screencast so expect that to show up here sometime this weekend.

Goals for my experiment (or what I'll be doing in my screencast):

  1. Allow multiple diffrent providers (save Linq to XML due to casting constraints in Linq to XML) to expose the same objects up to a single business class
  2. Make a factory where by settings could be uses to pass the correct provider to its caller such that the caller is provider ignorant about the Linq it is using.
  3. Validate that there are no obvious performance hits caused by this (Most importantly tha linq to SQL doesn't do something "wacky" that caues it to speu crazy SQL rather than sain SQL).

I am happy to say I achived all of these goals, and now you'll just have to wait to see how :-)..

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Time to give Ruby another shot?

clock October 10, 2007 08:17 by author josh

The IIS team has finally released the new FastCGI module for IIS 6 and 7.. I won't know until I try to get it setup if it will work for me BUT (fingers crossed).. with any luck this will allow me to atleast have all of my work served out of one instance of IIS instead of IIS for my .NET work and Apache + Mongral Clusters for my Rails work.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Dynamic Record proxy for RoR webservices.

clock June 11, 2007 22:49 by author josh
So I have taken the plunge and spent quite a bit of time playing with RoR (Ruby on Rails), in fact I decided to port my current projects serverside over to ruby to make the Ajax work easier and for the Experience. Along the way I had to write about 15 webservices to use for client server sync. Now if you don't know Ruby on Rails then the rest of this won't make much since so go of and learn a little rails and specifically ActionWebServices, then come back and you will think this is pretty cool :-) For the rest of you read on :-).

For security reasons Ruby on Rails doesn't support passing ActiveRecord objects to and from the client (not by default anyways). The fear is that someone will blindly pass in bad data, and the developer will just save it (without validation) therefore causing all kinds of issues. Now you can get around that by setting a parameter at the top of your ActionWebService::Base. But (at least for me) all that did was trade one problem (security) for another (exceptions being thrown because I don't use Integer ID's).  I thought about it a bit and I realized I would need ActiveWebService::Struct proxies for all of my objects. I looked at my 20 tables and realized that while that would be a pain , it wouldn't be "so" bad.. But hand writing a Struct for each of my objects, then one by one writing a "to" and "from" converter just didn't sound fun. Not to mention that it wasn' a long term solution. I mean what if the next project has 300 tables?

Deep in thought considering the problem I decided what I really needed to do was harness what it means to be a dynamic language. I wanted a module or base class, that would take a ActionWebService::Struct and a ActiveRecord, and dynamically do the translation for me.. Put a ActiveRecord in and get a specific ActionWebService::Struct out, put a Stuct in and get the "right" ActiveRecord back. To that end I wrote WsBase  
module WsBase 
@basedOnType = Class 
def map_from_class (type) 
   if (!type.base_class == (ActiveRecord::Base)) 
       raise(ActionWebServiceError, "ActiveRecord model classes is expected") 
   end 
   @basedOnType = type 
   type.columns.each do |prop| 
      member prop.name, prop.type 
   end 
end 
def fill_base(me) 
   mydata = me.dup 
   #raise @returnval.to_yaml 
   hashVal = Hash.new 
   @basedOnType.columns.each do |attrib| 
      hashVal[attrib.name] = mydata[attrib.name] 
   end 
   returnval = @basedOnType.find(:first, :conditions => ["id = ?", mydata["id"]]) 
   if (returnval == nil) 
      returnval = @basedOnType.new(hashVal) 
      returnval.id = mydata["id"] 
   else 
      hashVal.each do |field, val| 
       eval "returnval." + field + " = val" 
     end 
   end 
   return returnval 
end 
def fill_me(myRec,me) 
   myval = me.dup 
    myRec.attributes.each do |attrib,val| 
     eval "myval." + attrib + " = val" 
   end 
   myval.id = myRec.id 
   return myval 
end 
end 

The idea behind this module is that I create a 3 line proxy class that inherits from ActionWebService::Struct. I then extend it with this module and then add the line map_from_class ActiveRecordClassName.. Thats it. If I want to populate the Struct I pass in my ActiveRecord, If I want to get back my ActiveRecord, I pass in my populated Struct. The class files look something like this

class WsContact < ActionWebService::Struct 
   extend WsBase 
   map_from_class Contact 
end 

And a "read method" in my Webservice controller would look like this

def get_contact(contactId) 
   wcontact = WsContact.new 
   arcontact = Contact.find(:first, :conditions => ["id = ?",contactId]) 
   if (arcontact != nil) 
      returnval = WsContact.fill_me(arcontact, wcontact) 
     return returnval 
   end 
   return nil 
end 

and finally my write method would only need to be this

def save_contact(contact) 
   record = WsContact.fill_base(record) 
   if (record.save) 
      return "Good" 
    end 
   return "Bad" 
end

Now isn't that elegent. And best of all maintance for my model doesn't mean I have to update these classes, they automaticly change because they take on the properties of their ActiveRecord :-).. I even made the code cleaner by making the write function take a param of type, so instead of having 15 write methods I have 1 write method that gets called 15 diffrent ways.. and the write method doesn't change, again taking advantage of rubys dynamic nature, you can call static methods of a parameter :-P..

Anyways, this all qualified as TOO cool not to share in my book.. If anyone has any updates or suggestions on how to write this dynamic code I am all ears, I am a Ruby Neophite so I am sure my fill_base and fill_me functions could be optimized or follow do a better job of following Ruby best practices.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


View Webservices done.

clock April 30, 2007 06:57 by author Josh

So on our little project I have decided that because our fatclient will connect to the server via webservices, so should our webapp. Sure, sure its on the same server (now) but using SOA here helps in several ways.

1)  If we grow to a multie server enviroment it will be easy as pie to cut the webapp away from the business layer (as it will already be using the webservices

2) I only have to write my webservices once, and I don't have to write a bunch of wrapper classes just so the webapp can call right back to the BAL while the fatclient has to go thru webservices.

3) I can make the webapp 100% HTML. Now you may be asking, but then its just a webpage. True, but with AJAX I have actually been quite successful writing 100% javascript HTML clients to my webapps. The idea being that static file serving is light, easy, cheap (doesn't require IIS or windows for that matter), and finally it completely decouples business logic from the UI allowing solid design practices.

4) We can publish a Webservice API for client websites to use as they like.

So with all that being said, as of yesterday I completed all of the webclient Services for searching and rendering. Now I have a few new entry points (Scope creep) to write. But the "core" webclient APIs are done. On the flipside my partner is working on the Fatclient and he will give me his list of APIs to write when he is ready. We have split up the project, with him getting the fatclient and me doing everything on the server.. Its a fair trade :-).

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Adobe Flex Goes Open Source

clock April 27, 2007 17:18 by author Josh
Big news from Adobe. This will make Flex the de-facto standard for Rich Internet Applications. Now this is intresting, Because Flex is the dynamic form of Flash, and has quite a bit of Web 2.0 magic. I wonder how this folds in to the whole Apollo project.

read more

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


MMM Hardware

clock April 27, 2007 13:35 by author Josh
AuctionAds, a eBay powered advertising widget, shows there rack and talks a little about there. read more to check out a well stacked rack!   read more

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


SOA Primer

clock April 27, 2007 12:07 by author josh

        SOA or Service-Oriented Architecture is a concept born in the enterprise as a way to not only abstract logic but centralize installations. Basicly what SOA is, is a methodology of placing your enterprise business logic into Services like Webservice, J2EE, Soap or some kind of RPC. As such SOA can be implemented in any platform as long as it supports some RPC (Remote Procedure Calls) technology, and as such is also a great method of extending compatibility across platforms. 

         What this allows you to do is further abstract your layers (now there is a technology layer between them) and it lets you centralize installation of logical chunks of code. Instead of having a Business application object that is installed everywhere you can wrap it in a service and have a Business application Service.  Once its a service, any other application can consume it and those developers don't have to have access to the code, settings, data, etc..

       SOA is a good thing and can be used in a bunch of diffrent ways, but don't get carried away. As a general rule I use SOA when developing code that will have multiple types of customers, where I don't know who all will be using it, or when its setup is constrained (by licensing, settings, security, etc..) and as such we can't just copy it all over the place.

       Anyways I'm going to be babbling about this stuff once I really get into work on our projects and I figured a little primor would make future posts more "understandable".

 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5



Calendar

<<  November 2008  >>
MoTuWeThFrSaSu
272829303112
3456789
10111213141516
17181920212223
24252627282930
1234567

View posts in large calendar

Add to Technorati Favorites

Sign in