I have decided that I am going to start on a new project. I have been trying to think up ideas of what I am going to base my project on and have come up with an enterprise application based on where I currently work and how I would like the current software to run. I am wanting to base it on Microsofts ASP.MVC and see if I can use JQuery.
I intend this to be a learning excercise and a chance to cement much of my current learnings.
Wednesday, September 16, 2009
Tuesday, March 31, 2009
Future Learnings
I am a big advocate of self continuous improvement, and I am constantly looking for new resources for learning my trade.
This morning in my daily web trawl I came across this link talking about how to become a hacker.
And it inspired me to use some of my spare time to learn a few more programming languages.
In the article Eric gives his recommendations on what languages to learn:
So far the programming languages under my belt are (I have left out scripting languages such as HTML):
I'm also wanting to delve deeper into multi threaded and parallel programming as I can see that the future is in spanning across multiple CPU cores.
Well that's about all for today.
This morning in my daily web trawl I came across this link talking about how to become a hacker.
And it inspired me to use some of my spare time to learn a few more programming languages.
In the article Eric gives his recommendations on what languages to learn:
So far the programming languages under my belt are (I have left out scripting languages such as HTML):
- C# .NET (this is my current language of choice)
- Java (My University had a bend towards teaching Java as a first language then really didn't touch on other languages too much).
- BASIC
- Javascript
I'm also wanting to delve deeper into multi threaded and parallel programming as I can see that the future is in spanning across multiple CPU cores.
Well that's about all for today.
Labels:
how to become a hacker,
Languages,
Learning
Tuesday, March 24, 2009
He who holds the data
Just this morning, my colleague Justin passed me this link to a talk by Hans Rosling at TED. I was very impressed by Hans' presentation on multiple levels:
As a worker for a humanitarian organisation:
* data showing the shift in the poverty margin of countries around the world.
As a software professional:
* Data Representation and Presentation
* and the sourcing of the data and Hans' ideas on opening up data on publicly funded research projects to be searchable by the public.
And as a member of the wider audience:
* How Hans did his presentation.
I was very encouraged by the data around the shift of where poverty laid in the world. It showed that the general trend was that poverty was somewhat on the decline, at least under the variables Hans provided (Life expectancy and wealth).
Hans presented a very humorous and entertaining, whilst informative and very pointed talk. His focus being on how preconceived ideas effects how we view situations and how data presented properly can debunk these ideas and educate people on the real state of affairs.
The software Hans used in his talk was very eye opening. It was cool to display trends by selecting items and tracking them over time using animations, as well as the ability to drill down further into the data.
But the real crunch was at the end when Hans started talking about how the "curators" of publicly funded research were refusing to make it possible for the general public to search. I honestly believe that research done with public funding, should be made available to the public. Now I can understand that the databases containing this data can often contain information that needs explanation as to what it actually means, but this should really be documented.
When I finished watching this video, I was left with an overwhelming feeling of WOW and what do I do with this information now.
I think this needs more pondering.
As a worker for a humanitarian organisation:
* data showing the shift in the poverty margin of countries around the world.
As a software professional:
* Data Representation and Presentation
* and the sourcing of the data and Hans' ideas on opening up data on publicly funded research projects to be searchable by the public.
And as a member of the wider audience:
* How Hans did his presentation.
I was very encouraged by the data around the shift of where poverty laid in the world. It showed that the general trend was that poverty was somewhat on the decline, at least under the variables Hans provided (Life expectancy and wealth).
Hans presented a very humorous and entertaining, whilst informative and very pointed talk. His focus being on how preconceived ideas effects how we view situations and how data presented properly can debunk these ideas and educate people on the real state of affairs.
The software Hans used in his talk was very eye opening. It was cool to display trends by selecting items and tracking them over time using animations, as well as the ability to drill down further into the data.
But the real crunch was at the end when Hans started talking about how the "curators" of publicly funded research were refusing to make it possible for the general public to search. I honestly believe that research done with public funding, should be made available to the public. Now I can understand that the databases containing this data can often contain information that needs explanation as to what it actually means, but this should really be documented.
When I finished watching this video, I was left with an overwhelming feeling of WOW and what do I do with this information now.
I think this needs more pondering.
Labels:
Data Presentation,
Hans Rosling,
TED
Tuesday, March 17, 2009
Layer Transparent Paging
I am currently working on an issue where I am processing large amounts of data. So I have decided to implement a paging strategy.
Now my issue was that I am wanting to pass this paging strategy from my Data Access Layer (DAL) to my Buisness Logic Layer (BLL) without exposing my underlying framework which happens to be NHibernate.
So I have devised the interface:
This I can then pass through to my BLL to iterate through the results like so:
Allowing the PagedResult object to handle all session and transaction issues.
I also devised a way to put my query into the PagedResult object using Lambdas:
This allows me to use it as such:
Cheers,
Erik
Now my issue was that I am wanting to pass this paging strategy from my Data Access Layer (DAL) to my Buisness Logic Layer (BLL) without exposing my underlying framework which happens to be NHibernate.
So I have devised the interface:
public interface IPagedResult<T> : IEnumerator<IList<T>>
{
int PageSize { get; }
IPageSession Session { get; }
}This I can then pass through to my BLL to iterate through the results like so:
using (var pagedResults = DAL.GetPagedResultsForSomething())
{
while (pagedResults.MoveNext())
{
foreach (var item in pagedResults.Current)
{
doSomethingWithItem(item);
}
}
}Allowing the PagedResult object to handle all session and transaction issues.
I also devised a way to put my query into the PagedResult object using Lambdas:
public class PagedResult<T> : IPagedResult<T>
{
private int currentResult = 0;
public delegate ICriteria QueryFunction(ISession session);
public PagedResult(int pageSize, ISession session, QueryFunction query)
{ ... snip ... }
public vool MoveNext()
{
try
{
Current = query(session)
.SetFirstResult(currentResult)
.setMaxResults(PageSize)
.List<Statement<T>();
if ((Current == null) || (Current.Count == 0))
{
Current = null;
return false;
}
currentResult += PageSize;
return true;
}
catch
{
session.Transaction.RollBack();
throw;
}
}
... snip ...
}This allows me to use it as such:
var statementId = 1;
var pageSize = 10;
new PagedResult<Statement>(
pageSize,
new Session(),
s =>
s.CreateCriteria(typeof(Statement), "statement")
.SetResultTransformer(CriteriaUtil.DistinctRootEntity)
.Add(Restrictions.Eq("statement.Id", statementId))
);
What do people think?Cheers,
Erik
Labels:
.NET,
C#,
Lambda,
NHibernate,
Paging,
Software Development
Monday, March 9, 2009
Handling Cartesian Products in NHibernate
I have been using NHibernate for a little while now, but I am mostly self taught in this. I have recently done a course on ADO.NET to try and understand some of the basics of data access that I may have missed, and also to get a little of an understanding of the core technologies behind NHibernate.
I was reading a post on Eager Loading by Derik Whittaker on the Devlicio.us site where Derik was talking about returning a list of objects using the CreateCriteria query method. His issue was that when he used Eager Loading, he got more rows back then expected. This was due to the Cartesian Product issue where the join on the tables caused extra rows to be returned for a single object and NHibernate hydrating an object for each row. His solution was to include the command:
which can be shortened to:
While reading through the comments on this post I found that someone had posted:
Why didn't you use the CreateMultiCriteria method?
This got me thinking. I have heard of MultiCriteria before but never realised that you could use it to solve the Cartesian Product problem before.
So to Google I went and I found the NHibernate Documentation and to my surprise I found the example under CreateMultiQuery. I had never found this before because I had always limited my reading to the CreateMultiCriteria (which is a more fluent version of MultiQuery).
So now the challenge I have set myself is to sit down and try to get some examples of this working.
Till next time.
Erik
I was reading a post on Eager Loading by Derik Whittaker on the Devlicio.us site where Derik was talking about returning a list of objects using the CreateCriteria query method. His issue was that when he used Eager Loading, he got more rows back then expected. This was due to the Cartesian Product issue where the join on the tables caused extra rows to be returned for a single object and NHibernate hydrating an object for each row. His solution was to include the command:
.SetResultTransformer( new DistinctRootEntityResultTransformer() )which can be shortened to:
.SetResultTransformer(CriteriaUtil.DistinctRootEntity)While reading through the comments on this post I found that someone had posted:
Why didn't you use the CreateMultiCriteria method?
This got me thinking. I have heard of MultiCriteria before but never realised that you could use it to solve the Cartesian Product problem before.
So to Google I went and I found the NHibernate Documentation and to my surprise I found the example under CreateMultiQuery. I had never found this before because I had always limited my reading to the CreateMultiCriteria (which is a more fluent version of MultiQuery).
So now the challenge I have set myself is to sit down and try to get some examples of this working.
Till next time.
Erik
Labels:
.NET,
C#,
Cartesian Product,
MultiCriteria,
NHibernate
Thursday, March 5, 2009
New Findings: AOP & PostSharp
I was just browsing through the latest MSDN magazine today while waiting for a rather long integration test to run, and I found an article on Aspect-Oriented Programming (AOP). Now I have heard of AOP and have been told that it is a very effective programming paradigm, but have never fully looked into it before. In the article the author (Scott Michell) presents an open source framework called PostSharp. Now I spent a good while looking through the website and some examples and I am impressed. The power with PostSharp is that you define a custom attribute which extends from one of PostSharps base classes and you can write code for cross cutting concerns such as logging, security, etc into this attribute and place the attribute on the properties in your class and the PostSharp.Core puts your code into the class at compile time.
I'm looking forward to sitting down and having a play with this framework as it looks really positive. Anything that promises to improve my coding practices is worth a bit of my time.
I'm looking forward to sitting down and having a play with this framework as it looks really positive. Anything that promises to improve my coding practices is worth a bit of my time.
Labels:
.NET,
AOP,
C#,
Open Source,
PostSharp,
Software Development
Thursday, February 19, 2009
Division or Disunion
This is by no means the first time that I have attempted to start a blog. I have started blogs in the past but have never made it past the first blog. This time I have decided that I will spend the last fifteen minutes of each day to write about something I have learned for the day.
Hence the name "Crossing the Schism" where I see this particular schism as being my best intended but ultimately unsuccessful attempts to join the wider Internet community by writing my thoughts down.
Right now I am due for a meeting.
So until next time.
Hence the name "Crossing the Schism" where I see this particular schism as being my best intended but ultimately unsuccessful attempts to join the wider Internet community by writing my thoughts down.
Right now I am due for a meeting.
So until next time.
Subscribe to:
Posts (Atom)