Search Results

Search found 3 results on 1 pages for 'phonicuk'.

Page 1/1 | 1 

  • Where ORMs blur the lines between code and data, how do you decide what logic should be a stored procedure, and what should be coded?

    - by PhonicUK
    Take the following pseudocode: CreateInvoiceAndCalculate(ItemsAndQuantities, DispatchAddress, User); And say CreateInvoice does the following: Create a new entry in an Invoices table belonging to the specified User to be sent to the given DispatchAddress. Create a new entry in an InvoiceItems table for each of the items in ItemsAndQuantities, storing the Item, the Quantity, and the cost of the item as of now (by looking it up from an Items table) Calculate the total amount of the invoice (ex shipping and taxes) and store it in the new Invoice row. At a glace you wouldn't be able to tell if this was a method in my applications code, or a stored procedure in the database that is being exposed as a function by the ORM. And to some extent it doesn't really matter. Now technically none of this is business logic. You're not making any decisions - just performing a calculation and creating records. However some may argue that because you are performing a calculation that affects the business (the total amount to be invoiced) that this isn't something that should be done in a stored procedure and instead should be in code. So for this specific example - why would it be more appropriate to do one or the other? And where do you draw the line? Or does it even particular matter as long as it's sufficiently well documented?

    Read the article

  • "Never do in code what you can get the SQL server to do well for you" - Is this a recipe for a bad design?

    - by PhonicUK
    It's an idea I've heard repeated in a handful of places. Some more or less acknowledging that once trying to solve a problem purely in SQL exceeds a certain level of complexity you should indeed be handling it in code. The logic behind the idea is that for the large majority of cases, the database engine will do a better job at finding the most efficient way of completing your task than you could in code. Especially when it comes to things like making the results conditional on operations performed on the data. Arguably with modern engines effectively JIT'ing + caching the compiled version of your query it'd make sense on the surface. The question is whether or not leveraging your database engine in this way is inherently bad design practice (and why). The lines become blurred further when all the logic exists inside the database and you're just hitting it via an ORM.

    Read the article

  • Sorting out mSSD acceleration on a Acer M3-581TG

    - by PhonicUK
    I recently purchased a Acer Timeline M3 Ultra, it ships with a 500GB HDD and a 20GB mSSD to use as a cache. First thing I did when I got it was format the drives and install a clean OS (on the HDD, the mSSD has nothing on it) - but now I can't figure out how everything needs to be configured in order to use the mSSD as a cache, it just looks like a standard storage drive. I've poked around in the BIOS and there is a SATA mode setting, but it only has one option (AHCI), most of the documentation I've seen on the subject says that the SATA controller needs to be in RAID mode otherwise 'Acceleration' isn't visible in the Intel SRT menu (which for me, it isn't) I've seen a few things that suggest I just need the correct partition layout, I tried this using fdisk from a Linux LiveCD but got nowhere. Any ideas? The laptop shipped with no recovery media so I'm marginally stumped. I don't have any issue with reformatting again if required.

    Read the article

1