Someone asked me the other day, "Why do FWS array & hash methods have the name hash and array in them ( i.e. somethingHash() and somethingArray() )?" What a great question! So I figured I would write a little article about why that was done - because it wasn't the first time someone asked :)
Method names in FWS have a theme to help people that write in different language or are new to programming make it easier to get started. There are a couple more conventions like this if your familiar with FWS, but the convention we will cover here are arrays & hashes. When getting data from default methods of FWS you usually are getting arrays of hashes or a single hash. Here is an example:
my @dataArray = $fws->dataArray( type=> 'this_type' );
This will give me back an array of hashes of anything that matches this type. For a single hash that would have been returned you would retrieve it like:
my %dataHash = $fws->dataHash( guid => 'some_guid' );
And this theme is repeated pretty much anywhere that uses arrays of hashes. There is one extra piece this is handy for advanced FWS coders, and that is the use of a reference. The other convention is the ability to use the ref => 1 into the parameters, when used you will retrieve the array as an array reference. This is great for larger arrays, and are more efficient in general because your pointing at the list, not copying it to a new array every time you ask for it.
my $dataArrayRef = $fws->dataArray( type=> 'this_type', ref => 1 );
The idea of references sometimes takes a few for new Perl programmers to pick up, but once you get the hang of them, you should use the ref => 1 all the time.
CPAN release 10 is now live as version FWS-V2-1.13091122. This release is the landmark of the CLI version of FWS and the web rendering version combined. With combining them the CPAN version will now share the same version system as the web rendering version so... I guess its not fair to call it release 10 anymore. Thanks for everyones hard work making this transition. An extended recognition to Richard Crawford, Julia Hollender and Amanda Lewis. Hats off to them, and everyone that took part in this release!
Why is this good?
# My server knows about FWS - lets just use its version and we are
# good to go for web rendering
If your server has the current FWS installed, no need to maintain it per instance. This update is promoted to enhance use of cloud based hosting with FWS and instant installs that no longer require pulling the core package down when creating a new instance. Your admin package can still be independent of the core code which allows even more versatility, and exciting customization opportunities for the future!
Current development and master branch at github:
If you would like to be involved in our open source project and be part of the FWS team let us know at development (at) frameworksites.com. There is several initiatives bringing new functionality and wider support to FWS.
- October (2)
- July (1)
- June (2)
- May (1)
- April (1)
- March (3)
- Febuary (2)
- January (1)
Get FWS 2.1
Getting a FrameWork Sites installation is easy:
- Log into this site
- Click FWS Installations
- Add your domain name
- Click the install link
- Use your FWS Website!