These were all very helpful, especially Daniel's explanation of business logic. It cleared up a lot. thanks guys!
Blue On Jan 19, 12:20 pm, Richtermeister <nex...@gmail.com> wrote: > Hey Blue, > > just to add to the good previous posts, > I would describe "business logic" as the "rules and behavior" of an > application. > > For example, you may have a client that want to receive an email for > every order that is placed in your online store. > Except for weekends. In that case he wants to receive only one email > on monday morning that contains all orders. > The code that decides whether to send a single email or a bulk email > is part of your business logic. > > Or another example are memberships. Say you only allow access to > certain areas if a user has paid membership fees for the current > month, than the code that controls this behavior is your business > logic. > > Or backordering. If your product inventory goes to zero, you initiate > a process that orders an appropriate amount of products to replenish > the inventory again. You see how business logic applies everywhere > really? > > The way I look at business logic is that there is no right or wrong > way to do things, > it is simply the code represenation of what a human wants an app to > do, and how to do it. > It can change quite often, depending on what you learn from the way > your app performs, > and generally it can sit in several layers at the same time. > During development I often have BL sitting in the control layer (the > action classes) and then slowly move it into the model layer. > > For example and action method that registers a new customer could > initially also send the welcome email. > However, the same call could be moved into a registerCustomer function > on the CustomerPeer.. really makes no difference until you start > duplicating code somewhere in the controller. That's the sign that > it's time to move code to the model and just call it from separate > places. > > Hope this helped, > Daniel > > On Jan 18, 12:23 pm, Nicolas Perriault <nperria...@gmail.com> wrote: > > > On Sat, Jan 17, 2009 at 3:39 PM,blue92877<bluepres...@gmail.com> wrote: > > > If you can help better explain, that would be great - more layman > > > terms while I become comfortable with OOP concepts. In fact, if you > > > were explaining it to a non computer programmer or just-beginning > > > computer programmer, how would you explain it? > > > Let me try: > > > - The Model is your business, the raw data and the rules you need to > > make them usable and useful ; > > - The View is the way you show these data to the end user (or anything > > which can understand the format you use to decorate them) ; > > - The Controler takes the data from the Model and gives them to the > > View from the user input (in a Web context, it's mainly the url and > > maybe some associated parameters). > > > Well, that's hard. Hope it helps anyway. > > > ++ > > > -- > > Nicolas Perriault > > Training and Consulting Manager at Sensio > > Labshttp://prendreuncafe.com-http://symfonians.net-http://sensiolabs.com > > Pro phone: +33 140 99 82 11 > > Mobile: +33 660 92 08 67 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~----------~----~----~----~------~----~------~--~---