473,695 Members | 3,090 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Bussines objects

Hi!
I'm making a database application and i heard from a friend that it is more
proffecional and easy to do this with bussines objects. Can anyone tell me
where i can find more info on bussines objects and how to implement them
with c#? I would appreciate any help. Thanks.
Nov 16 '05 #1
38 3719
A "business object" is just a class that represents a real entity with
which you work. For example, if you work with customers and orders, then
you might have a Customer class and an Order class.

Check out the following link:

http://www.mygenerationsoftware.com/...s/dOOdads.aspx

The tool from MyGeneration can create C# code for business objects
automatically from tables in a database. Then you can bind controls in
your gui to that.

Radi Radichev wrote:
Hi!
I'm making a database application and i heard from a friend that it is more
proffecional and easy to do this with bussines objects. Can anyone tell me
where i can find more info on bussines objects and how to implement them
with c#? I would appreciate any help. Thanks.

Nov 16 '05 #2
"Patrick B" <ne*******@devz oo.com> a écrit dans le message de news:
#R************* *@TK2MSFTNGP10. phx.gbl...
A "business object" is just a class that represents a real entity with
which you work. For example, if you work with customers and orders, then
you might have a Customer class and an Order class.

Check out the following link:

http://www.mygenerationsoftware.com/...s/dOOdads.aspx

The tool from MyGeneration can create C# code for business objects
automatically from tables in a database. Then you can bind controls in
your gui to that.


As useful as you might think such a tool is, I would seriously advise
against using database design as the foundation for class design. There are
several patterns, like foreign keys, that are not necessarily correct in OO
world.

e.g.

Database
========
SalesOrder
ID
Date
CustomerID (FK)
Tax
Total

OrderLine
ID
OrderID (FK)
Quantity
ProductID (FK)
LineValue

Classes
=======
SalesOrder
ID (unique ID held internally, not used in client code, just by storage)
Date
Customer (object not ID)
Lines (composite list only accessed through AddItem method on this class)
Tax
Total

OrderLine
ID (unique ID held internally, not used in client code, just by storage)
Quantity
Product (object not ID)
LineValue

It is usually the job of a mapping layer to maintain the solution to this
apparent mismatch between the Object Layer and the Database.

Joanna

--
Joanna Carter
Consultant Software Engineer
Nov 16 '05 #3
I wholeheartedly disagree wtih this statement.
As useful as you might think such a tool is, I would seriously advise
against using database design as the foundation for class design. There are
several patterns, like foreign keys, that are not necessarily correct in OO
world.


Your application in the end exists only to manipulate data, the data is the
application, everything line of code your write exits to flip a bit or save a
value in your database. Starting with the database and working from the
ground up is an excellent and proven way to write an application, and is how
most do it.

Once you have your database design you can then use that very useful AND
accurate data to generate the classes that represent that data. MyGeneration
does exactly that.

Mike Griffin
MyGeneration Software
http://www.mygenerationsoftware.com
Nov 16 '05 #4
"MyGenerati on" <My**********@d iscussions.micr osoft.com> a écrit dans le
message de news: D8************* *************** **...icrosof t.com...
I wholeheartedly disagree wtih this statement.
You are entitled to your opinion but...
Your application in the end exists only to manipulate data, the data is the application, everything line of code your write exits to flip a bit or save a value in your database. Starting with the database and working from the
ground up is an excellent and proven way to write an application, and is how most do it.
Database design used to be the standard, well-proven basis for non-OO
applpications; I know, I was weaned on Logical Data Structure diagrams.

But where do you put the code that manipulates the data ?

Please don't tell me you use data-aware controls directly connected to
database tables and write the code in event handletrs on the forms!! :-))

Not all data in an application is stored in a database. In a well designed
OO application you may well have hundreds of classes that have nothing to do
with *stored* data.

The frameworks I have written to support my applications contain around 300
classes and interfaces.

There is the Value Type Framework that gives me more metadata about my
business objects and their properties.

There is the Object Persistence Framework that allows me to write OO code
that knows nothing about databases because the OPF translates business
objects to/from database tables, generating SQL on the fly. I only ever use
one Query component, one Transaction component and on database component in
my entire application and frameworks combined.

There is the MVP framework that allows me to replace my UIs without having
to change any of the code in either my business objects or the applications
that use them.

etc...

How would I extract those classes and interfaces from a database ?

What about those applications that don't use databases ?
Once you have your database design you can then use that very useful AND
accurate data to generate the classes that represent that data. MyGeneration does exactly that.


How does your software translate the Sales Order example I gave ?

--
Joanna Carter (TeamB)

Consultant Software Engineer
TeamBUG support for UK-BUG
TeamMM support for ModelMaker
Nov 16 '05 #5
Hi,
"MyGenerati on" <My**********@d iscussions.micr osoft.com> wrote in message
news:D8******** *************** ***********@mic rosoft.com...
I wholeheartedly disagree wtih this statement.
As useful as you might think such a tool is, I would seriously advise
against using database design as the foundation for class design. There
are
several patterns, like foreign keys, that are not necessarily correct in
OO
world.
Your application in the end exists only to manipulate data,


No really, my application exist to solve a problem to the user. The data is
the core of it , but you cannot design all your application around it, you
have to design your application around the problem you are trying to solve.
Starting with the database and working from the
ground up is an excellent and proven way to write an application, and is
how
most do it.
Totally agreed with you, The DB design helps you identify the potentials
entities involved in the business layer and the relationships among them,
Now where I disagree with you is that you should take into account that the
requirements of the business layer is different that those of the DB layer,
ie you don;t have a third normal form for business layer that can assure you
have a good design.
The relationship among buss. entities are differents and others patterns
exists for this layer.
Once you have your database design you can then use that very useful AND
accurate data to generate the classes that represent that data.
About the original post question....

There are being lot of discussions in this groups about what is the best
approach to handle data in the business layer, You have two escenarios ,
when the business rules are simple and few and no transformations need to be
performed in the data itself, in another words the main use of your app is
showing/editing data. In this escenario IMO is better to keep the data in a
dataset.

IF you have complex business rules and relationships then you are better
creating custom business objects that better describe the problem.
MyGeneration does exactly that.


That may be a very useful tool !!!!
I started using a similar feature in Rational's XDE but I never could figure
out how.

Do you provide a demo version ?

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation



Nov 16 '05 #6
There are samples on our home page. As for a demo version MyGeneration is
100% free, there is no trial version, it's simply free. We also have
Gentle.NET, NHibernate, Opf3, and DAAB templates in addition to our own
dOOdads architecture.

And I don't care what the business requirements are I aways generate the
code and customize from their (without worrying about regeneration), see this
page:

dOOdads at 10,000 feet
http://www.mygenerationsoftware.com/...s/dOOdads.aspx

We use this technique on Fortune 50's and 100's and it works everytime, our
clients are simply amazed by our speed and reduced cost, and above all the
maintainability .

dOOdads usage in C#
http://www.mygenerationsoftware.com/...terSample.aspx

Everyone has their own opinions sure, but your saying "Don't do that it, it
only works on simple projects" without offering any proof.
Nov 16 '05 #7
Hi,

We use this technique on Fortune 50's and 100's and it works everytime,
our
clients are simply amazed by our speed and reduced cost, and above all the
maintainability .
The size of the company does not mean nothing, it's the requirements and
complexity of the system what does.
A complex system will get better beneficies of the framework of course.
dOOdads usage in C#
http://www.mygenerationsoftware.com/...terSample.aspx

Everyone has their own opinions sure, but your saying "Don't do that it,
it
only works on simple projects" without offering any proof.


I did not say that. I said that this is a recurring subjects in the
newsgroup. and that several strategies are followed by different developers.
I personally do not disregard a dataset or datatable to keep data all the
way up to the UI, and do use it when the data is only to get dumped. It has
worked for me before. When using it? well that's the decision (and taste) of
the designer :)
cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
Nov 16 '05 #8
Yeah People that's verry nice but what i asked for was some Info on business
objects, not software for automaticaly implementing them.

Nov 16 '05 #9
"Radi Radichev" <co******@minet .uni-jena.de> a écrit dans le message de
news: eZ************* *@TK2MSFTNGP14. phx.gbl...
Yeah People that's verry nice but what i asked for was some Info on business objects, not software for automaticaly implementing them.


Business Objects is a term used for any class that describes a business
concept; e.g. Customer, Invoice, Person, Shape, Computer, Vehicle, etc.

The big advantage of using BOs is that all your business logic resides in
those objects rahter than being placed in event handlers on forms.

Most folks who start using a RAD IDE like VB, Delphi or VS, tend to place
database components on a form, hook up data-aware components directly to the
tables in the database and then try to figure out which event to place code
to react to changes in either the tables or edits.

This approach is doomed to fail (or take longer to get right) for all but
the simplest of projects.

If you design your BO layer, it need know nothing about either database or
UIs. This means that all your business logic is encapsulated in the BO layer
and you can change your database or UI without having to re-write.alter any
of your business logic code.

That is essentially what business objects are; however, to use them
efficiently, you will also need some method of translating the values in the
properties of your BOs so that they can either be stored in/retrieved from a
database or displayed in edits on forms.

This is where frameworks like OPF or MVP come in useful (see my other post).
However for UIs created in .NET, as long as your BO classes are designed
correctly, it is possible to use 'data-aware' controls to hook up directly
to the properties of your objects and to your lists of objects.

Does this answer your question any better ?

Joanna

--
Joanna Carter (TeamB)

Consultant Software Engineer
TeamBUG support for UK-BUG
TeamMM support for ModelMaker
Nov 16 '05 #10

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

Similar topics

2
8243
by: dasod | last post by:
I would like to know if my method to remove list objects is correct in this small test program. It seems to me that there might be a simplier way, but I'm afraid I don't know enough about list iterators and how they are behaving in situations like this. #include <iostream> #include <list> class Test; typedef std::list< Test* > Tlist;
11
1787
by: thechaosengine | last post by:
Hi all, I have a very general but quite significant question about objects. My question is, when should I create them? I know thats a crap question so let me explain a bit further. Lets take an example of user management against a database. Things I might like to do include:
9
1882
by: Aguilar, James | last post by:
Hey guys. A new question: I want to use an STL libarary to hold a bunch of objects I create. Actually, it will hold references to the objects, but that's beside the point, for the most part. Here's the question: I want to be able to change the references (including deleting them). Is there any way to do that besides using pointers rather than references for the STL library? I'd also prefer to avoid using const_cast, if it is indeed...
6
2569
by: Alfonso Morra | last post by:
I have written the following code, to test the concept of storing objects in a vector. I encounter two run time errors: 1). myClass gets destructed when pushed onto the vector 2). Prog throws a "SEGV" when run (presumably - attempt to delete deleted memory. Please take a look and see if you can notice any mistakes I'm making. Basically, I want to store classes of my objects in a vector. I also have three further questions:
161
7826
by: KraftDiner | last post by:
I was under the assumption that everything in python was a refrence... so if I code this: lst = for i in lst: if i==2: i = 4 print lst I though the contents of lst would be modified.. (After reading that
7
8218
by: Jo | last post by:
Hi, How can i differentiate between static and dynamic allocated objects? For example: void SomeFunction1() { CObject *objectp = new CObject; CObject object;
21
2207
by: George Exarchakos | last post by:
Hi everyone, I'd like your help... Can we have a std::list<BASEwhere BASE be the base class of a class hierarchy? I want to add to this list objects that are inherited from BASE class but not necessarily the same... class base { int x;
27
2556
by: SasQ | last post by:
Hello. I wonder if literal constants are objects, or they're only "naked" values not contained in any object? I have read that literal constants may not to be allocated by the compiler. If the Standard is saying that "object is a region of storage", I deduce from that that literal constants aren't objects because they may not be alocated as regions of storage in the memory.
14
6012
by: Jess | last post by:
Hello, I learned that there are five kinds of static objects, namely 1. global objects 2. object defined in namespace scope 3. object declared static instead classes 4. objects declared static inside functions (i.e. local static objects) 5. objects declared at file scope.
0
8640
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
9001
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
8860
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
8832
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
7672
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6498
isladogs
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...
0
4348
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4587
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3018
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 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.