Abstract article (as in law) class? [OOP design]

  • (3 Pages)
  • +
  • 1
  • 2
  • 3

31 Replies - 1396 Views - Last Post: 22 November 2012 - 06:51 AM

#16 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9574
  • View blog
  • Posts: 36,268
  • Joined: 12-June 08

Re: Abstract article (as in law) class? [OOP design]

Posted 15 November 2012 - 12:37 PM

yeah, but in cold hard robot justice world they presume you will be screwing up (gotta catch all the possibilities of failure), and only have one condition for success.

Spoiler

Was This Post Helpful? 0
  • +
  • -

#17 jon.kiparsky  Icon User is online

  • Pancakes!
  • member icon


Reputation: 8010
  • View blog
  • Posts: 13,716
  • Joined: 19-March 11

Re: Abstract article (as in law) class? [OOP design]

Posted 15 November 2012 - 12:39 PM

Skynet runs on a Mac Plus? Golly!

This post has been edited by jon.kiparsky: 15 November 2012 - 12:39 PM

Was This Post Helpful? 0
  • +
  • -

#18 lucky3  Icon User is offline

  • Friend lucky3 As IHelpable
  • member icon

Reputation: 231
  • View blog
  • Posts: 769
  • Joined: 19-October 11

Re: Abstract article (as in law) class? [OOP design]

Posted 15 November 2012 - 01:04 PM

We're loosing the big picture in details. Suppose you write very simplistic constitution for virtual country first. It could have 5 or 30 articles only. Then build on it. How would you start, how would your base Article class design look like?
Was This Post Helpful? 0
  • +
  • -

#19 jon.kiparsky  Icon User is online

  • Pancakes!
  • member icon


Reputation: 8010
  • View blog
  • Posts: 13,716
  • Joined: 19-March 11

Re: Abstract article (as in law) class? [OOP design]

Posted 15 November 2012 - 01:07 PM

I would have to know what it is I'm representing. When you suggest a constitution, I'm thinking of a text object. Since this has a tree structure, I would try to capture that, in order to facilitate future work with it. That would be reflected in code as some sort of Node object, as you'd expect, and the hard copy on disk (the copy of record) would probably be in some structured markup.

But if we're not talking about text objects, I'd need to know what it is we're talking about before I could tell you how I'd represent it.
Was This Post Helpful? 1
  • +
  • -

#20 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9574
  • View blog
  • Posts: 36,268
  • Joined: 12-June 08

Re: Abstract article (as in law) class? [OOP design]

Posted 15 November 2012 - 01:09 PM

Well not so much as getting lost in the details, but there should be a discussion on how this setup is going to be used. Use can play a large part in form and some function.
Was This Post Helpful? 1
  • +
  • -

#21 lucky3  Icon User is offline

  • Friend lucky3 As IHelpable
  • member icon

Reputation: 231
  • View blog
  • Posts: 769
  • Joined: 19-October 11

Re: Abstract article (as in law) class? [OOP design]

Posted 15 November 2012 - 01:45 PM

Constitution of a country represents basic rules of law on its most abstract level. Each lower level act must comply with it, all the way down to most simplistic local regulations (as perhaps town's decree of not spitting on pavement or something...). Text is there just for humans, to understand the system. @modi we are talking of how to simulate real life law, but not to loose ourselves in details, I proposed a constitution as a starting point ( a really simplistic version of it), just to try to point out the essence of my original question in this topic.
Was This Post Helpful? 0
  • +
  • -

#22 jon.kiparsky  Icon User is online

  • Pancakes!
  • member icon


Reputation: 8010
  • View blog
  • Posts: 13,716
  • Joined: 19-March 11

Re: Abstract article (as in law) class? [OOP design]

Posted 15 November 2012 - 01:54 PM

Okay, so what is a basic rule of law at its most abstract level? What is the Platonic ideal of a law?
Assuming we're talking about criminal law, we could say that it's the association of a penalty to an action, but this might be a little thin for your purposes. It also leaves open the question of representing actions and penalties.

It might help if you clue us in on what we're building here. Are we talking about implementing a game, or a tool for lawyers in the real world, or some sort of educational software, or what
Was This Post Helpful? 1
  • +
  • -

#23 lucky3  Icon User is offline

  • Friend lucky3 As IHelpable
  • member icon

Reputation: 231
  • View blog
  • Posts: 769
  • Joined: 19-October 11

Re: Abstract article (as in law) class? [OOP design]

Posted 15 November 2012 - 02:01 PM

Ultimately - simulation of country's law system, that could be hooked to various scenarios. It could be used by lawyers, government (when introducing new legislation), DC's... For a start, it would be enough if there would be 5 or so articles in 1 act only. The point is in abstract reusable class, that could be used (perhaps inherited, with added functionality) on each lower layer of the law system.
Was This Post Helpful? 0
  • +
  • -

#24 jon.kiparsky  Icon User is online

  • Pancakes!
  • member icon


Reputation: 8010
  • View blog
  • Posts: 13,716
  • Joined: 19-March 11

Re: Abstract article (as in law) class? [OOP design]

Posted 15 November 2012 - 02:05 PM

And what is the functionality of a law?
Was This Post Helpful? 0
  • +
  • -

#25 lucky3  Icon User is offline

  • Friend lucky3 As IHelpable
  • member icon

Reputation: 231
  • View blog
  • Posts: 769
  • Joined: 19-October 11

Re: Abstract article (as in law) class? [OOP design]

Posted 15 November 2012 - 02:12 PM

Keeping things in order, setting limits of behavior, preventing anarchy... You can look at it (as you asked in your previous question) as a super realistic simulation in game, where the law (or single act) represents the scenario of how the game should run, what rules govern it. Each rule represents an article.
Was This Post Helpful? 0
  • +
  • -

#26 jon.kiparsky  Icon User is online

  • Pancakes!
  • member icon


Reputation: 8010
  • View blog
  • Posts: 13,716
  • Joined: 19-March 11

Re: Abstract article (as in law) class? [OOP design]

Posted 15 November 2012 - 02:23 PM

View Postlucky3, on 15 November 2012 - 04:12 PM, said:

Keeping things in order, setting limits of behavior, preventing anarchy...


That's the purpose, not the functionality. The purpose of a Queue is to hold items needing to be processed until they are ready to be processed. The functionality of a Queue is

enqueue(item) // add an item to the queue
dequeue() // return the highest-priority item (least-recently added, in the base implementation)
isEmpty // return false if the queue holds at least one item, true otherwise.


This functionality can be inherited by a PriorityQueue:

enqueue(item, priority) // add an item to the queue
dequeue() // return the highest-priority item (least-recently added, in the base implementation)
isEmpty // return false if the queue holds at least one item, true otherwise.

What is the functionality that a Law has?
Was This Post Helpful? 1
  • +
  • -

#27 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9574
  • View blog
  • Posts: 36,268
  • Joined: 12-June 08

Re: Abstract article (as in law) class? [OOP design]

Posted 15 November 2012 - 02:27 PM

Quote

What is the functionality that a Law has?

I know Mega City Municiple Code, 213: Willfull destruction of property, that's two years. Code 310: Illegal possession of assault weapons, five years. Code 457: Resisting arrest, TWENTY years! And code 3613: The first degree murder of a Street Judge... Death.
Was This Post Helpful? 0
  • +
  • -

#28 jon.kiparsky  Icon User is online

  • Pancakes!
  • member icon


Reputation: 8010
  • View blog
  • Posts: 13,716
  • Joined: 19-March 11

Re: Abstract article (as in law) class? [OOP design]

Posted 15 November 2012 - 02:30 PM

I didn't know Singapore had changed its name.
"Mega City"? I like it.
Was This Post Helpful? 0
  • +
  • -

#29 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 2271
  • View blog
  • Posts: 9,499
  • Joined: 29-May 08

Re: Abstract article (as in law) class? [OOP design]

Posted 16 November 2012 - 02:31 PM

Another approach would be to devise a Domain Specific Language (DSL).
Then write a Parser and Lexer for it.

Nemerle had that capability via the macros is the library Nemerle.PEG.
Simple Example
God I miss that language.

Or use some Fluent API style, so that the domain experts can understand it.
Was This Post Helpful? 0
  • +
  • -

#30 BobRodes  Icon User is offline

  • Your Friendly Local Curmudgeon
  • member icon

Reputation: 574
  • View blog
  • Posts: 2,989
  • Joined: 19-May 09

Re: Abstract article (as in law) class? [OOP design]

Posted 22 November 2012 - 12:47 AM

In some cases, it's simply a matter of did they break the law. The process that the OP is talking about is not to conduct trials by computer, but to charge people with violations of statutes. So, the idea of automating charges for traffic offenses makes some sense. An obvious example of this is the devices that generate tickets for people running red lights. However, it is clearly difficult to automate the process of charging for an assault or drug deal, for example, and I suspect the application is pretty limited in scope.
Was This Post Helpful? 0
  • +
  • -

  • (3 Pages)
  • +
  • 1
  • 2
  • 3