473,897 Members | 2,656 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Re: Object modeling question

siddharthkh...@ hotmail.com wrote:
I have three main entities in system ............... report ,
sections , lineItem.
Requirements :
a section can be create by assembling some line items together.

a report can be created by assembling some sections together.

A administrator will have functionality to delete or add to a master
list of sections and attributes.
so in other word there are delete and add operations happening on
sections and line items out side of a context of specific report.

OK to model this....
i will have a report object. That will hold a collections of sections
and each individual section will hold collection of line items.

Something like this...
Now lets assume that there are two types of consumers that will using
this object model. A web applications, A windows think client
Good luck. The behavior and conventions of web versus fat-client (or
paper-oriented) reports are so different that making a generic
anything that serves both of them without rewrite is a big challenge
unless you pick a lowest common denominator, which limits things.
what I am trying to find out by this questions and discussion
is ..What is the best way to model this and how your object model will
change when you move from web app to windows app.

Let's take example of web application ....

Use case is delete first line item that is with in first section and
sections is inside a specific report object..

so code in my web page will look like this...

But this a web app. in most cases you will not keep your report object
on postbacks. And obviously for performance reason you are not going
to re-create the full report object again on post back and then call
delete on that ...so here is my first question..

Where would you put the method to delete the line item from report?

Would you put it as an instance method directly on report object..as
shwon below?

Report.DeleteLi neItem(SectionI D,LineITemId)

If yes......

But another consumer form my object model is a windows app ...where It
may be ok to keep object in memory unlike web app.
so this call may be fine as i have a fully loaded report object in

so how would you come up with common object model that works for
both ...it is possible without writing more service layers?


Another use case....

Sections and line items can be deleted in the context of a report as i
described above
OR they can be deleted system wide by administrators .so if a section
or line item is not in use by any report presently admin can delete
them from the master list.

now question is what is the best place to put these delete method....

if i put them in the same sections and line items objects that I used
then i can write code like this....

LineItems.LoadA ll()
LineItems[0].DeleteSystemWi de()
but down side of this is ....they will be available in this call as

Report.Section[0].LineItem[0].DeleteFromSyst em();
This does not make sense because i am trying to delete system wide but
calling it on a specific report object....

So what are the solutions....

Should i use explicit interface implementation (c#)?
shoud i create separate classes and put them in separate name
spaces ..like admin.LineItem will have system wide delete function but
other line item class will not......this also is ugly because i am
creating two classes for same entity only because of this one
Any ideas and other ways to do it..?
If you have more than about 50 and they will be changing often by
different people, consider tracking report configuration settings in a

A "toy" example that sort of illustrates this can be found at:

Jun 27 '08 #1
0 1545

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

Similar topics

by: Redd | last post by:
The following is a technical report on a data modeling project that was recently assigned to me by my professor. I post it so that anyone else who is studying databases and data modeling can have an example to go by with their study of databases. I was assinged to come up with a data model, but I choose the Autoparts sales and inventory management schema. It you would like the SQL code to generate the schema or if you would like the ERWin...
by: DrUg13 | last post by:
In java, this seems so easy. You need a new object Object test = new Object() gives me exactly what I want. could someone please help me understand the different ways to do the same thing in C++. I find my self sometimes, trying Object app = Object(); Object *app = Object(); Object app = new Object();
by: Roger Smythe | last post by:
A means for the progressive decomposition a problem space into increasingly simpler component parts such that these component parts represent higher levels of conceptual abstraction, and are completely independent of each other except for their well-defined interfaces. This was an attempt to explain the gist of OOP to programmers accustomed to the structured programming paradigm. I tried to explain OOP in terms of ideals that can be...
by: Pmb | last post by:
Hi. I'm new to this group. I'm refreshing/learning C++ and am starting to learn Object Oriented Programming (OOP). In discussing this with people I came up short as to what the benefits of OOP are. For example: As I understand it, OOP has its main benefit in software reuse. Thus one develops a software library of classes and this cuts down the overhead of reinventing the wheel. Someone might say that this can be done with structured...
by: Mike | last post by:
I'm starting up on big project that will take much of my time in next year or two. Until now I was mostly self-employed on small projects so I didn't spent so much time modeling system before implementation. Sure, I wrote use cases now and then, draw UML in Visio but it wasn't matter of life and death. But because of scope in next project I'm kinda frighten that sooner or latter I along my team will get lost in poorly documentet...
by: Carl J. Van Arsdall | last post by:
It seems the more I come to learn about Python as a langauge and the way its used I've come across several discussions where people discuss how to do things using an OO model and then how to design software in a more "Pythonic" way. My question is, should we as python developers be trying to write code that follows more of a python standard or should we try to spend our efforts to stick to a more traditional OO model? For example, in...
by: =?Utf-8?B?SmVhbi1GcmFuY29pcyBCcmV0b24=?= | last post by:
"siddharthkhare@hotmail.com" wrote: The context is important in this kind of design concern : I assume there's a lot of user and that application will evolve to add richer functionality. My first concern would be to separate the business logic code from data contener : the new code would look like that : LineItemBusinessComponent.Delete(LineItemBusinessEntity) Exposing CRUD component isn't the best thing to do because your presentation...
by: H. S. Lahman | last post by:
Responding to siddharthkhare... Ignore Topmind and frebe. They are anti-OO P/R guys. Let's not confuse things with specific 3GL syntax. At the OOA/D level the model looks like: | 1
by: Thomas R. Hummel | last post by:
I'm going to try to describe this situation as best as I can, but if anything is unclear please let me know. Some of this database was already in place before I arrived on the scene, and I don't really have the buyin to change it. There is a table of certificates that a person can hold. A person may hold certificates of various types. I need to further group a person's certificates together so that (for example) renewal dates can be...
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...
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,...
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...
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,...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
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.