473,776 Members | 1,650 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Beginner design question

Hi,

I'm curious how others would deal with something I'm building.
The app itself is a form of diary; it allows the organisation of diary
entries and a number of other data types.
Each diary entry is listed under its title, and double clicking brings
up the full entry and options for editing.
Each entry and associated option is stored in a diary object instance.
I'm wondering how best to store the persistent data. One option is
to a file on the users HDD. Each time the app is opened the file is
read and all diary instances are recreated. But I'm worried that
storing every diary instance in memory will create an ever increasing
memory footprint.
The other option I've thought of is creating a db file on the users
HDD, and only reading what information is needed. For example, when a
list of diary entries is shown, just the title fields are read into
memory. On double clicking a title, the entire record is fetched and an
instance of diary object created.

Which one of these would be the best solution? Or is there something
else more suited?

Another quick question: Are there any pre-made controls for the
richtextbox control? E.g. bold, italic, font type, colour buttons etc?
Or do all have to be created?

Any help would be appreciated!

Paul

Dec 19 '05 #1
2 1167
Is this for personal / local use, or intended for a wider audience?

If this is for personal use, or use amongst friends, keep in mind that
most computers these days have enormous amounts of memory. It would
take one heck of a prodigious and dedicated writer to fill up 512 Mb,
IMHO.

That said, if this is intended as a commercial product then you have to
be pickier about resource usage.

In the former case, the quick-n-dirty solution is to simply place the
entries in an XML file. When you start the app, read the XML into
memory, add an edit entries, then write it out again when your app
exits (or do intermediate saves to guard against data loss on crashes).

However, if this is to be a "real" application, you really do need to
use a database. MS just came out with SQL Server Express, which I
believe is a freely-distributable mini version of SQL Server for the
desktop. This would be ideal. You could also use an Access database,
but personally I think that Access isn't long for this world, so I
wouldn't recommend that.

A database would certainly make for a longer-lived, better-functioning
application. The XML solution is just a quicky.

If you really wanted to be clever, you could design yourself a data
layer interface something like this:

public interface IDiaryDataLayer
{
DiaryEntrySumma ryCollection GetSummaries();

DiaryEntry GetEntryDetails (DiaryEntrySumm ary entry);

void InsertEntry(Dia rtyEntry entry);

void UpdateEntry(Dia ryEntry entry);
}

....and any other methods or properties you'll need from your data
layer. Then you could write the XML data layer:

public class DiaryXmlStorage : IDiaryDataLayer
....

in order to test your application, then, later, you could work on the
database layer:

public class DiaryDataBaseSt orage : IDiaryDataLayer

and just plug it in in place of the XML data layer. In fact, you could
write any class you wanted and so long as it implemented
IDiaryDataLayer , your diary application could use it to store and
retrieve diary entries.

Dec 19 '05 #2

"Bruce Wood" <br*******@cana da.com> wrote in message
news:11******** **************@ g47g2000cwa.goo glegroups.com.. .
desktop. This would be ideal. You could also use an Access database,
but personally I think that Access isn't long for this world, so I
wouldn't recommend that.


Note that MsAccess is also a stripped SQL Server internally.
But it requires a Office license and so I agree. SQL Express 2005 is a great
chioce.

- Michael S
Dec 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

44
4284
by: lester | last post by:
a pre-beginner's question: what is the pros and cons of .net, compared to ++ I am wondering what can I get if I continue to learn C# after I have learned C --> C++ --> C# ?? I think there must be many know the answer here. thanks
14
2294
by: z_learning_tester | last post by:
But I can't seem to find the answer. The question is how do you reverse the words in a string? Or how do you reverse the numbers listed in a string? The example is usually something like: Turn this string "1,2,3,4,..." Into "...4,3,2,1" This one seems hard enough let alone trying to turn a string of space-seperated words around(is that even possible? a trick question
17
3095
by: C_beginner | last post by:
Am I did the following program corectly according to the question? Question: /* 1:You have just been employed by MacroMuscle, Inc. (Software for Hard Bodies). The company is entering the European market and wants a program that converts inches to centimeters (1 inch = 2.54 cm). The company wants the program set up so that it prompts the user to enter an inch value. Your assignment is to define the program objectives and
4
1236
by: --- | last post by:
I'm writing up a sample program to teach someone the basics of database application design. I'm using the 2.0 framework and Microsofts default "pubs" database. What I'd like to do is create a simple app that connects to the database and allows browsing, editing, creation and deletion of books and authors. I'd like to show a good application architecture, with clear seperation of data access, business logic (simple as it is), and...
3
1407
by: anke | last post by:
hi all, i am fairly new to css. i know the very basics, can work with scripts and adapt them. i learned webdesign in the late 90ies and have troubles forget about my beloved tables ;-) anyway, i designed a homepage which i completely want to code in CSS and without frames. since i am such a beginner with CSS layouts, i'd like to know how i would divide my page in divs. i understand that i would create a container with a fixed size, and...
4
2670
by: Johs | last post by:
I am looking for a good C++ book for beginners. I have some experience with C and a lot of experience with Java. I am currently reading Bjarne Stroustrups C++ Programming Language but it starts off rather complex without examples of compiling modules or making and using classes. Is there some C++ books that takes you through the whole process of making modules, compiling them and using classes?
5
2747
by: macca | last post by:
Hi, I'm looking for a good book on PHP design patterns for a OOP beginner - Reccommendations please? Thanks Paul
6
2478
by: Solo.Wolve | last post by:
I've just finished the K&R c, And begin to study c++ myself,so can anyone give me some advice?such as some books to read,and something to notice? Thank you very much.
4
2024
by: subramanian100in | last post by:
In the book, C++ Coding Standards book by Hereb Sutter and Andrei Alexandrescu, in Item 40 on pages 86-87 viz, "Avoid providing implicit conversions", the authors have advised the use of named functions that offer conversions instead of conversion operators. In page 87, example 2: Errors that work. class String { // ...
2
3527
by: nicholas08 | last post by:
I am new to programming and trying to work on a simple console app. I am making a simple Library Management system where the user/admin can manage members and item. Attaching the menu so it's clear to understand what I am saying. http://i475.photobucket.com/albums/rr116/nicholasCsharp/Untitled.jpg So far I have only looked at Item and Member Management (option 1 and 2) Few question I had: 1. In terms of the design approach I am taking. One...
0
9628
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9464
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10289
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10120
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10061
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9923
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5493
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3622
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2860
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.