|
Thank you Jonathan, that made the picture clear!
|
|
|
|
|
|
All very true and all good advice. However, the danger is that your Computer interface is going to become very bloated. Consider that a computer contains not just a motherboard and one or more CPUs, but also hard drives, a USB bus (plus any USB devices which may or may not be connected), a floppy drive (if your computer is as old as mine), a graphics card, a network card, a sound card, RAM, etc. etc. etc. (I'm sure you can think of a few more components.)
Exposing every possible operation for every possible component through the Computer class interface leads to a very unwieldy design. The danger is that your Computer class becomes a sort of "god" object which tries to do everything and be all things to all men.
There are no hard and fast rules for object design. There is a certain amount of give and take to end up with the best solution, balancing one consideration against another.
|
|
|
|
|
I agree. In general I'm all for an architecture designed someone who recognises there can be rules there in the first place. Investigating what the Law of demeter is (I knew the principle but not the actual rule) and why it's used, and why in other cases it's perhaps not used, can only be a good thing.modified on Tuesday, March 9, 2010 5:41 AM
|
|
|
|
|
I'm a C#.Net programmer and what I like to do is separate classes that only hold data and those that have functionality.
I like that architecture because it's clear cut and I can immediately find any data or method and don't have to think long about it or search around where some method is.
I think it's a good approach for multitier architecture, so when I'd change the database I wouldn't have to change all classes but only the ones that handle db connection.
On the other hand I'm not quite sure if that's really object oriented programming.
For example I need to read some data about hotels out of a db, edit it and write it back. I'd have a hotel class and a dbconnection class.
The hotel class only holds data like rooms, prices, etc. without any methods (except for a deep copy method I add to all my classes) and dbconnection class has all the methods.
I can't really see the advantage of adding the methods for connecting to the db to the hotel class, but that would be actual oop, while I'm doing something close to procedural programming or?
|
|
|
|
|
Megidolaon wrote: I can't really see the advantage of adding the methods for connecting to the db to the hotel class, but that would be actual oop, while I'm doing something close to procedural programming or?
What you have done is keep a clear separation of concerns, and that's good practice (as well as being good OOP)."WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Have you considered a HotelManager class? The hotel has things such as rooms, but its the HotelManager that actually uses your data to make money out of the hotel building. Setting, say, a price per room or having rooms cleaned by a cleaning company is definitly something the HotelManager rather than the 'Hotel' does. What we consider 'hotel' in reality is actually a combination of the HotelBuilding and the HotelManaqer. Taking this view, it's the HotelManager who should interact with the your data, rather than the hotel.
|
|
|
|
|
This is an interview question I faced a couple of days back.
The person asked me to draw fully the System Architecture of my project, diagaram of how the three layers (since I told him that my project is three layer architecture)are communicating each other etc?
Even though I draw something, he replied that didn't clearly depict the architecture.
I have the following questions:
1) When we say System Architecture diagram, it shouldn't contain any functionaltiy? Or does it mean that how the system flows from top to bottom?
2) Is this represented through UML or some other ways?
3) How to draw the communication between the three layers?
Any help in this regard please? or any good site for the articles?
Thanks
meeram395Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
Not really a fair question since your definition of the diagram might be different from his yet no less right or wrong.
Systems architecture[^]
Read the overview. I'm sure there will be many conflicting opinions over this but, for me, if you can clearly depict and understand the various layers and interactions of the application that should be fine (unless the job was for an architect!).
also: Software architecture[^].
Whilst Wiki articles should not be taken as the final authority they can be quit ehelpful.Tychotics: take us back to the moon
"Life, for ever dying to be born afresh, for ever young and eager, will presently stand upon this earth as upon a footstool, and stretch out its realm amidst the stars."
H. G. Wells
|
|
|
|
|
I have installed Visual Studio 2008 Express edition in my home pc. I want to download and use the Application blocks for .Net.
When I tried to download Enterprise Library 4.1 2008, the system requirement says that the system should have Standard Edition or Professional Edition or TeamEdition or Team Suite. Does it mean it will not work for Express Edition?
In that case, is there any possible way to use the Application blocks in Express Editions? Please help.
ThanksSuccess is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
meeram395 wrote: In that case, is there any possible way to use the Application blocks in Express Editions?
No; since the Express editions are free, they have reduced functionality. If you want to use these libraries then you will need to buy one of the commercial editions.txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
How can I design a software Internet Firewall?Can you give one structure chart of Internet firewall and its explanation on working?
|
|
|
|
|
This question is impossible to answer in a technical forum. Try searching Google for some documentation on TCP/IP and firewalls; you will find plenty to keep you occupied for a few weeks. txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
I'm a college student and as part of my work I have to make a game in XNA (does not include life cycle)
I want to do this well and have researched software life cycles and such but many only apply to multiple developers or are too big i.e. dive into publishing and marketing which I don't need.
Is there anyone who can share some life cycles so that I can have a structured development?
Thanks!
|
|
|
|
|
|
There are lot of free UML tools available. I need any single one, which should be good (possible to draw all sort of diagrams and manipulate them), just for learning purpose.
Can anyone please recommend which one should I choose? Can I download the same and install?
Please suggest.
Thanks
meeram395. Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
StarUML[^] is a good one. It's no longer actively developed, but that doesn't take away from the underlying quality of it."WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Thank you very much Pete!! Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
You're welcome."WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
"NClass" is pretty good for designing UML for c# applications here
|
|
|
|
|
Hi folks !
I'm trying to design an application (in C++ but that doesn't matter I guess, anything object-oriented would work the same) which has to synchronize a bunch of events together.
Basically, you would have a several data structure instances which would contain lists of events. An event would have a timestamp and be "runable".
The application would have to synchronize all the events, i.e : "run" them when their timestamp is equal to the current time, with an accuracy of 0.1 millisecond.
Also, I would like to be able to input some additional events "real time" (as close as it can get to real time actually)
I'm simply looking for the best way to do this (not necessarily to code it, but to design it, in terms of class digram). I have been googling a bit for that but I didn't find much. Apparently there's something called the "scehdule-task design pattern" but couldn't find any info about it.
Any hints or ideas ?
|
|
|
|
|
I have a question:
Suppose my application is having a three layer architecture, contains UI Layer, Business Layer & Data Layer. Now think that, these three layers can be build and deployed seperately.
Now my question is, how the communication between the UI layer and Business Layer or BusinessLayer and Data Layer be happen? In other words, if there is a method in Buisness Layer class referenced in UI Layer, how the UI Layer should know it should call the particular class in Business Layer?
Is it happen through WebServices? Would be great if any article relating to this subject.
Regards
meeram395
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
Web Services, Sockets, Named Pipes, MSMQ, they can communicate through whatever means is most applicable to your scenario. There isn't one technology that fits all problems, you have to look at your problem and figure out which technology solves it best.
meeram395 wrote: how the UI Layer should know it should call the particular class in Business Layer?
There needs to be some coupling between the two layers to make this happen. Inside the UI layer there's a distinction between what is displayed and how it's displayed. The what is the part that's coupled to the rest of the system - it's the information that's sent to and from the service/business layer to so it's job. This is where the UI layer needs to know what the rest of the system does. How it displays it is totally up to the UI layer, that's the part that's completely independent from the rest of the business logic. The basic designs to separate these parts inside the UI layer are MVC, MVP and MVVM. Here's[^] a quick and dirty on those.
|
|
|
|
|
Thanks Jimmanuel, Thanks a lot. This fully answers my query. And thank you for the article.
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
Glad to help
|
|
|
|