Quantcast

Maximum PC

It is currently Sun Dec 28, 2014 1:03 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: format for a new application
PostPosted: Sun Jun 21, 2009 1:17 pm 
8086
8086

Joined: Sun Jun 21, 2009 12:57 pm
Posts: 2
I am creating a new application for personal use and would like to solicit some input on what languages/libraries/etc I should use.

I am making a little program to help me schedule my landscaping chores to end the needless killing of innocent plants (paper schedules aren't cutting it).

I need to have:
1. GUI to make it easy to use
2. OO so i can have planter classes, plant classes, etc.
3. A Calender library so I dont need to do all those calculations myself
4. Some form of persistence (since I need to be able to store info even when the app isnt running.)

I am most experienced in C++ since that is what I used most in college, but so far JAVA seems like my best bet. Unfortunately I don't know what I should use to handle the persistence issue (XML, JDBC ...).

I have experience with relational databases, but I have a feeling that may be overkill for a simple app like this.

Initially I want it to be like something you could make using PHP/MySQL, but I want it to be standalone and not browser based.

Any Thoughts?


Top
  Profile  
 
 Post subject:
PostPosted: Sun Jun 21, 2009 6:51 pm 
Million Club - 5 Plus*
Million Club - 5 Plus*
User avatar

Joined: Sun Sep 12, 2004 6:37 pm
Posts: 4745
Location: In the monkey's litterbox
You can pick whatever language you want to do it in (even C++), but I find GUI's really easy to code in C#.

For persistence, you could use sqlexpress or sqlite. Or you could use the XML serialization built into .NET for C#.


Top
  Profile  
 
 Post subject:
PostPosted: Mon Jun 22, 2009 3:44 am 
SON OF A GUN
SON OF A GUN
User avatar

Joined: Mon Nov 01, 2004 5:41 am
Posts: 11605
+1 for Sql Express. There is also SQL Compact that does not require Sql Server to be installed.

I am a fan of C# and I think it would be really good for your project, a good place to start.

There are lots of other things you can do but it would help to ask some more specific questions.

I would create a new solution in visual studio and create the following projects:
Common
DataAccess
Business
<NameOfYourApplication>App (for example, LandscaperApp if I called my program Landscaper).

Then all of your common/utility function go in common. You can then reference common in the other projects. All data access / interfaces to your data store is in data access which is referenced in the business project where all your classes (planter, plant, etc) are. The business class is reference in the "App" project, where all of your GUI stuff is located.


Top
  Profile  
 
 Post subject:
PostPosted: Mon Jun 22, 2009 12:33 pm 
Super Mario Banhammer
Super Mario Banhammer

Joined: Fri Aug 25, 2006 11:20 am
Posts: 595
.NET and C# have the utility you need.

SQLExpress and or SQLCompact are good choices for persistence if you need relational persistence. XML is good for non relational persistence (unless you REALLY REALLY LIKE creating custom schemas and dds files to define the relationships between your XML files in which case you have my sympathies)


Top
  Profile  
 
 Post subject:
PostPosted: Tue Jun 23, 2009 7:46 am 
8086
8086

Joined: Sun Jun 21, 2009 12:57 pm
Posts: 2
I've never used C#, but looked at some info and think it may be a little easier for the GUI setup then JAVA's swing. My only questions now would be:

1. What is a easy to use (and preferably free) development tool I could use.?

2. Will there be an easy way to implement all the calender functionality in C#? I will need to be able to do things like compare the current date/time to a past date/time (to see if the current date is two weeks past another for example) and add days/weeks to a date/time to get a new one.

Thanks for the replies so far!


Top
  Profile  
 
 Post subject:
PostPosted: Tue Jun 23, 2009 8:37 am 
SON OF A GUN
SON OF A GUN
User avatar

Joined: Mon Nov 01, 2004 5:41 am
Posts: 11605
First question is easy... I will get to the second one shortly.

Because this is a personal project and you aren't going to try to sell it, you can use this: http://www.microsoft.com/exPress/

Download page: http://www.microsoft.com/express/download/

.NET has a "DateTime" object. Comparing them and working with them is very easy. .NET has lots of other powerful libraries like this:

Code:
DateTime AWeekAgo = new DateTime();
DateTime Today = new DateTime(2009, 06, 23, 12, 30, 0); // June 23, 2009 at 12:30:00 PM

AWeekAgo = Today.AddDays(-7); // June 16, 2009 at 12:30:00 PM

TimeSpan TimeBetweenDates = Today - AWeekAgo;

if (TimeBetweenDates.Days == 7){
            Console.WriteLine("This was a week ago!");
}


Top
  Profile  
 
 Post subject:
PostPosted: Wed Jun 24, 2009 7:46 am 
Super Mario Banhammer
Super Mario Banhammer

Joined: Fri Aug 25, 2006 11:20 am
Posts: 595
CrashTECH wrote:
First question is easy... I will get to the second one shortly.

Because this is a personal project and you aren't going to try to sell it, you can use this: http://www.microsoft.com/exPress/

Download page: http://www.microsoft.com/express/download/

.NET has a "DateTime" object. Comparing them and working with them is very easy. .NET has lots of other powerful libraries like this:

Code:
DateTime AWeekAgo = new DateTime();
DateTime Today = new DateTime(2009, 06, 23, 12, 30, 0); // June 23, 2009 at 12:30:00 PM


AWeekAgo = Today.AddDays(-7); // June 16, 2009 at 12:30:00 PM

TimeSpan TimeBetweenDates = Today - AWeekAgo;

if (TimeBetweenDates.Days == 7){
            Console.WriteLine("This was a week ago!");
}


Just be very careful if you do Datewise math with .NET DateTime objects. For example attempt to cross the midnight barrier with a granularity narrower than 1/300th of a milisecond (this might seem a little more granular than you would expect but in my world of translating mainframe and batch job runs into web based output this is a very real requirement) and you are liable to end up with an invalid date for your result such as December 31st 1899 11:59:59.9999. This is due to the way Microslop stores DateTime information. Most of the free world (aka NOT MS) stores a date and a time as seperate entities OR as a single 8 Byte entity counting forward from some arbitrary "system on date" aka Unix

Not Microsoft. They store DateTime as two seperate 4 Byte entities concatenated together the left hand side of which contains day month and year info and the right hand side containing Hour Minute Second and divisions of a second down to 1/300th of a milisecond. (Yes I realize that that is .0300 of a second and is pretty precise on a macro scale but with todays cpu's processing instructions at 3 Ghz and more speeds on multiple cores the granularity thing starts to become an issue.) On top of that nice little obfuscation scheme Microsoft translates the two 4 bytes of date data into a single 8 byte date data not by simple concatenation which is bad enough but they manage to actually translate that into a higher order of obfuscation by setting 01/01/1900 00:00:00.000 as the "counter date" and each processor tick incrementing that 8 byte variable by 1, so that what you have is 0x00000001 = 01/01/1900 00:00:00.001, 0x00000002 = 01/01/1900 00:00:00.002 and so on. the 8 byte number is hex of course which gives you a larger register to work with for counting purposes, but its still not going to be accurate when compared with date data from other systems. So watch this carefully, as you program.


Top
  Profile  
 
 Post subject:
PostPosted: Wed Jun 24, 2009 8:54 am 
SON OF A GUN
SON OF A GUN
User avatar

Joined: Mon Nov 01, 2004 5:41 am
Posts: 11605
IMO, the MS way makes more sense. I hate dealing with (on a daily basis) a timestamp that looks like this: 9845982763867324576234 or whatever.

If you need that:
Code:
DateTime.Now.Ticks


Quote:
A single tick represents one hundred nanoseconds or one ten-millionth of a second. There are 10,000 ticks in a millisecond.

The value of this property represents the number of 100-nanosecond intervals that have elapsed since 12:00:00 midnight, January 1, 0001, which represents DateTime.MinValue.


Not to knock you Max but I don't like MS bashing or it assuming that the MS way is wrong. Especially when there is a very easy way to get what you (I think) need.

For the most part you aren't going to care if it is 2x4 bytes or 8 bytes.


Top
  Profile  
 
 Post subject: Re: format for a new application
PostPosted: Tue Jul 21, 2009 8:22 pm 
8086
8086

Joined: Sun Apr 12, 2009 9:14 am
Posts: 13
x-fission wrote:
I am creating a new application for personal use and would like to solicit some input on what languages/libraries/etc I should use.

I am making a little program to help me schedule my landscaping chores to end the needless killing of innocent plants (paper schedules aren't cutting it).

I need to have:
1. GUI to make it easy to use
2. OO so i can have planter classes, plant classes, etc.
3. A Calender library so I dont need to do all those calculations myself
4. Some form of persistence (since I need to be able to store info even when the app isnt running.)

I am most experienced in C++ since that is what I used most in college, but so far JAVA seems like my best bet. Unfortunately I don't know what I should use to handle the persistence issue (XML, JDBC ...).

I have experience with relational databases, but I have a feeling that may be overkill for a simple app like this.

Initially I want it to be like something you could make using PHP/MySQL, but I want it to be standalone and not browser based.

Any Thoughts?


Java would be fine, free and relatively simple. You can use streams to manage file input/output with very little effort. Java provides the ObjectInputStream and ObjectOutputStream classes for reading and writing of serialized data. Meaning that any class you write should include the Serializable interface (conveniently, it requires no method implementation). The syntax is simple, similar to C++, minus the headaches such as multiple inheritance, memory allocation, etc. An extensive set of libraries exist (packages, see java.sun.com APIs) for data structures, common algorithms, I/O, GUIs through Swing, and more. NetBeans is an IDE that provides a visual GUI creation interface along with other nice features such step-through debugging and (to borrow a Microsoft term) intellisense. Eclipse is another such IDE, though you would have to dig around for a drag and drop GUI.


Top
  Profile  
 
 Post subject: Re: format for a new application
PostPosted: Tue Mar 02, 2010 12:54 am 
Bitchin' Fast 3D Z8000*
Bitchin' Fast 3D Z8000*
User avatar

Joined: Tue Jun 29, 2004 11:32 pm
Posts: 2555
Location: Somewhere between compilation and linking
It sounds like Java is a good choice for you.

>I need to have:
>1. GUI to make it easy to use
Creating Swing apps is very easy in NetBeans.

>2. OO so i can have planter classes, plant classes, etc.
It isn't very often that I run into a class hierarchy that I haven't seen somewhere else.... this is the first plant/planter hierarchy that I've come across. =)

>3. A Calender library so I dont need to do all those calculations myself
Check. Be careful not to fall into the trap of using deprecated methods though.

>4. Some form of persistence (since I need to be able to store info even >when the app isnt running.)

As Jason suggested, all you really need to do is write out your data structures using serialization. If that doesn't work for you, another option would be to use an embedded database like Berkeley DB.


Top
  Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

© 2014 Future US, Inc. All rights reserved.