datePicker and multi month picker

I have a need to build a kind of booking system, reservation system. Which related to start date and end date of staying. Then i rushed on google for date picker component. Which was quite easy task. There are plenty of them out there.

However, then i considered of what would make user in hospitality easy to work with date chosen? Considering you are looking for a hotel for you holiday, then what would be your starting day and how long will you stay? Mostly, you plan about 15days or 1 month ahead, and about 15 max staying day. OK then, how are we going to help them? traveler and Res Officer.

Then i came up with looking for multi months view at the same time. So can choose this month or next month at one shot. Check out the link below:
Interesting page about datePicker

You will find all your needs about datetime stuffs.

Main Screen consideration

As purpose of my application: I want to make an application to input word definition, work like input words into dictionary. And also want to see
word definition picked up randomly in some criteria: Like category, dictionary.
So the question is what the main screen should look like?

Obviously, the most common actions will be:

  1. Adding words
  2. Displaying random words
  3. Might want to search for some words
  4. Then come to category, dictionary management

Still thinking ….
After a while, i decided to have these things in the main view, i will use View instead of Screen.
As every software has, it has Logo and menu.

  1. Place to add new word directly.
  2. Place to display random words.
  3. A set of commands to be called from main view, like: create new word, edit word, create new dictionary, create new category,
  4. Ability to search word by keyword, and call up an advanced search

Based on those stuffs, i can come up with building MainModelView class. Quite simple, just contains all information needed to display in View. Remember that, we are in MVVM model, so the ModelView only contains data NOT any specific GUI implementation.

(I will put code here when i finish )

From the specification above, i come up with 2 user controls:

  1. User control for adding new word
  2. User control for displaying random words

One thing lefts, how to position them in main view?

Re-done with NHibernate

As written in previous post, i do re-read the article from Ayende. Yes, to make sure, i fully understand what he is talking about.
OK, i come up with these in my application:

  1. Session’s lifetime is inside a ModelView life: Created automatically when it is first called. And disposed when the ModelView is disposed. These will be done in ModelViewBase class
  2. Keep the idea of DatabindingFactory and Interceptor. However, there is no need for PublisherEvent here. Since i do not need it now.

And of course, borrow all code to initialize NHibernate :p

Next will be MVVM in detail and GUI of the application. From each GUI, i can define scenario for it clearly. Have a better chance of right implementation

First fail with WL

As i mentioned in my plan: Building a desktop application, quite simple for the first version. I also mentioned about technologies usage: NHibernate + WPF with MVVM model.

I also did some researches on that model, also have done some projects with NHibernate ( web application).  Therefore, i am quite confident to start up. And i did start up. Put all framework code and prototype of MVVM in place, in fact i copied and pasted from others. You can find them in my should read page.

Well, things were not that easy. I ran the project, it was fine for the first look. However, it did not do any db action. In fact, i did not know why NHibernate did not contact with DB when i made some query. Even wrap them up in a transaction. I have been working on finding out why. BUT the most important thing i found out is that: I DO NOT UNDERSTAND THEM CLEARLY.

So what they actually are???

  1. I did not define my application clearly. I mean the workflow of each action. For instance, what happen when i create a new word. Since it will help me define the scope of unit of work
  2. I did not understand the article from Ayende clearly. Not read it carefully enough.
  3. Wow reading MVVM one time does not mean i understand it completely. I know it but NOT GOT it.
  4. Even though, in MVVM, the view is separated from others. However, designing a good looking view will inspires you a lot. And i am terrible at making GUI

And, what i am going to do now are:

  1. Design the GUI. It is as a part of learning XAML.
  2. Re-read 2 articles from should read.
  3. Start defining the lifetime of session. Define workflow for each scenario.

After all these fails, am i sad? NO. I am happy to find them out.