|
Lets say I have 3 classes: Category, Book, and BookCollection. Objects of Category class will have a BookCollection which is simply some container which contains all the books within that category. These classes also have a method Save() which saves them to a permanent storage. Now when Category's Save() method is called, should it just save the category or the books within the category as well? What are the advantages and disadvantages?
If Category.Save() only saves itself, then clients will also need to call Category.Books.Save(). What is better? Also, should BookCollection.Save() traverse the books and call Save on each or will it do all the saving?
I guess it depends on the context but is there a convention?
CodingYoshi
Visual Basic is for basic people, C# is for sharp people. Farid Tarin '07
|
|
|
|
|
Hi,
this is how I see it:
1.
a phone directory holds a number of phone numbers; the phone numbers are not saved separately, it is the directory that holds them.
2.
a filesystem directory holds (or seems to hold?) a number of files; however you can read and write files without explicitly accessing their directory, so the file is a real object. The directory basically is just holding information on files (say FileInfo objects, which do not get saved separately).
3.
now which of those two cases your Book application ressembles most?
if you want to save and restore individual books, use (2) and threat your BookCollection as a list of book references, so saving that would be e.g. a file containing book/file names.
if wou do not want to save and restore individual books, use (1)
BTW: I am not convinced your Category class makes much sense, IMO Category would be an enum, and each book would have a Category property; you Category class could just be another BookCollection holding some of the Books (the once with matching Category property), or an enumerator inside BookCollection yielding only the Books with matching category.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Thanks for the reply.
This is not a real application so the classes are just "hypothetically speaking". However, if it was a real application, Category can still be a valid class because you can create, delete, modify categories as well. Then category will have more properties like id, name, description, books etc.
If it is an enum then we can not accommodate the above.
Nonetheless, your answer really helped me.
CodingYoshi
Visual Basic is for basic people, C# is for sharp people. Farid Tarin '07
|
|
|
|
|
Hi to all,
I need your help. Actually I have to develop a Learning Management System (LMS) Software. But I don't the architechture and how to go for it. Can somebody give the steps how to start. What would be the design? I want to develop it in .net
cheers,
sneha
|
|
|
|
|
sneha Choudhary wrote: Can somebody give the steps how to start
Get the users' requirements.
sneha Choudhary wrote: What would be the design?
That depends on the requirements.
Regards
David R
---------------------------------------------------------------
"Every program eventually becomes rococo, and then rubble." - Alan Perlis
|
|
|
|
|
First, Get the requirement documented.
If possible come up with a prototype of your system.
In doing so, you will get the objects, and attributes and various relationships... from there you can get into your design and then development.
|
|
|
|
|
I have built 2 learning management systems from the ground up in ASP.NET/C# and SQL Server. This is going to be a long task depending on the business requirements. Have fun with SCORM and AICC. You might want to give some thought in buying a low cost LMS or using a free one like Moodle. The first one I build took 2 years because of all the features it needed. Like the previous poster said....get the business requirements first and then go from there. Good luck.
|
|
|
|
|
I couldn't find any brainstorming or thought process tool. Could somebody please provide me a link either a web based or windows based.
Thanks
|
|
|
|
|
|
netJP12L wrote: I couldn't find any brainstorming or thought process tool.
Maybe this will work[^]
|
|
|
|
|
Because of a unique licensing and work logistics situation, I'd like to know if anyone has ever tried to convert between StarUML and Visio. Is there some universal "UML" format that can be understood by both products?
My knowledge of both products is slim and have not found any discussion online about this.
|
|
|
|
|
puromtec1 wrote: Is there some universal "UML" format
XMI[^]
puromtec1 wrote: I'd like to know if anyone has ever tried to convert between StarUML and Visio.
I have not. I don't know if either product supports XMI, I will leave that investigation to you.
|
|
|
|
|
Thanks. Appreciated.
Btw, your profile page is a trip.
|
|
|
|
|
I have researched the compatibility between starUML and Visio. Apparently, the standard XML for describing UML, called XMI, can be read and exported by both Visio and starUML.
StarUML can import and export XMI
http://staruml.sourceforge.net/en/about-2.php
Visio can export to it (I assume it can read it, too)
http://msdn.microsoft.com/en-us/library/aa140339.aspx
I will be testing this out, probably.
|
|
|
|
|
Is it conceptually possible and/or appropriate to create a use case, robustness and sequence diagrams for a sql stored procedure? This would allow business analyst to see clearly what the stored procedure is doing and its purpose.
|
|
|
|
|
It's possible since the user in a use case is not necessarily a person; could be a process (whatever calls the SP).
If it helps the BA then why not do it? In my experience BAs need all the help they can get.
Regards
David R
---------------------------------------------------------------
"Every program eventually becomes rococo, and then rubble." - Alan Perlis
|
|
|
|
|
|
When designing a Robotics system with an interface needed to a database, without creating Action Diagrams and Sequence diagrams which showed the everyone concerned the planned interaction between User, Robot and Data I don't think the project would have suceeded. So sounds good to me.
|
|
|
|
|
Thanks. Like everything database oriented, it typically isn't treated the same as developing with oop languages. I appreciate your input.
|
|
|
|
|
hii...
i would like to know more about software development in 3-t architecture and its pros and cons.
|
|
|
|
|
|
Hi,
Are there any standards for programming a console application based on menus?
Please do not answer just "well, use switch.."
I mean, a big console application.. where you need to administrate something, adding, editing, deleting and listing registries, and submenus within menus... etc
I can easily model the libraries used by the console app, but it's kind of difficult to model the console application itself...
Help please? Tips?
|
|
|
|
|
Hello,
I am looking for a good book which explains how to identify objects from your requirements,how to map those objects into classes(Class diagrams) and then how to finally apply these class diagrams to create business methods using C#.
I am not looking for design patterns. I am purely looking for OOAD.
Please suggest me with good book.
Regards,
Pavas
|
|
|
|
|
Hi,
I need to submit project plan for certification, my project is elearning. Can anybody provide me some sample documents of project plan.
some of the topic to be covered are...
INPUTS
PROJECT PLAN DETAILS
Reuse/Customization Plan:
Project Schedule
Size, Effort, Schedule and Defect estimates
Deliverables & Milestones
Project Monitoring
Risk Management
Method for risk monitoring
Tailoring Notes
QUALITY PLANNING
Audits
Quality Control
Conventions used in the project
Configuration structure
Access Rights in Configuration Management Tool
Training effectiveness measurement
Thankyou
YPKI
|
|
|
|
|
Does anyone know of good books on the subject of managing complex (i.e. frakking large) software projects? Especially touching on good design principals for large projects, best testing practice and estimating the impact of changes etc ?
An ideal candidate would be one covering real life situations that wouldn't put my limited attention span to sleep in 5 minutes. Not asking much .
10110011001111101010101000001000001101001010001010100000100000101000001000111100010110001011001011
|
|
|
|